diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-29 21:05:22 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-29 21:05:22 +0200 |
commit | ea2f90e7d0e3a0bda886eeccb11b8d7dbbf0250e (patch) | |
tree | 342be473a6c395e26f042f81fbbc15aa59f0a4f4 /src/lib/eiotas_particle.c | |
parent | f14def04d0a38896d1321758604da6db2bdc2c49 (diff) | |
download | edoors-ea2f90e7d0e3a0bda886eeccb11b8d7dbbf0250e.zip edoors-ea2f90e7d0e3a0bda886eeccb11b8d7dbbf0250e.tar.gz |
eiotas_particle_add_destinations: use eina_stringshare_add_length, so we don't need tmp[] and memcpy
Diffstat (limited to 'src/lib/eiotas_particle.c')
-rw-r--r-- | src/lib/eiotas_particle.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/lib/eiotas_particle.c b/src/lib/eiotas_particle.c index 18fbdb5..2284843 100644 --- a/src/lib/eiotas_particle.c +++ b/src/lib/eiotas_particle.c @@ -94,7 +94,6 @@ EAPI void eiotas_particle_add_destinations(Eiotas_Particle *particle, char* dest int n; char *dst, *sep; Eina_Stringshare *shared; - char tmp[EIOTAS_MAX_PATH_LENGTH]; dst = destinations; for(; *dst;) { @@ -104,12 +103,8 @@ EAPI void eiotas_particle_add_destinations(Eiotas_Particle *particle, char* dest n = (sep-dst); if(n==0) { ERR("ignore empty destination"); - } else if(n+1>EIOTAS_MAX_PATH_LENGTH) { - ERR("buffer overflow (%d)",n+1); } else { - memcpy(tmp,dst,n); - tmp[n]='\0'; - shared = eina_stringshare_add(tmp); + shared = eina_stringshare_add_length(dst,n); eina_array_push(particle->dsts,shared); DBG("add dst >%s<",shared); } |