On Thu, Aug 12, 2010 at 11:28 AM, Enlightenment SVN <no-re...@enlightenment.org> wrote: > Log: > Fix memset usage > > > Author: lucas > Date: 2010-08-12 07:28:30 -0700 (Thu, 12 Aug 2010) > New Revision: 51041 > > Modified: > trunk/e/src/modules/illume-home/e_mod_main.c > > Modified: trunk/e/src/modules/illume-home/e_mod_main.c > =================================================================== > --- trunk/e/src/modules/illume-home/e_mod_main.c 2010-08-12 14:22:22 > UTC (rev 51040) > +++ trunk/e/src/modules/illume-home/e_mod_main.c 2010-08-12 14:28:30 > UTC (rev 51041) > @@ -340,9 +340,10 @@ > exe = strdup(desktop->exec); > else > { > - exe = malloc(p - desktop->exec + 1); > - memset(exe, 0, sizeof(exe)); > - if (exe) eina_strlcpy(exe, desktop->exec, p - desktop->exec + 1); > + size_t s = p - desktop->exec + 1; > + exe = malloc(s); > + memset(exe, 0, s);
Why not just use calloc there? > + if (exe) eina_strlcpy(exe, desktop->exec, s); > } > if (exe) > { > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > enlightenment-svn mailing list > enlightenment-...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel