From ea2f90e7d0e3a0bda886eeccb11b8d7dbbf0250e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 29 May 2012 21:05:22 +0200 Subject: eiotas_particle_add_destinations: use eina_stringshare_add_length, so we don't need tmp[] and memcpy --- src/lib/eiotas_particle.c | 7 +------ 1 file changed, 1 insertion(+), 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); } -- cgit v1.1-2-g2b99