on 17/07/2013 11:41 Andrey Chernov said the following: > On 17.07.2013 12:35, Andriy Gapon wrote: >>>>>> - env = stpcpy(envVars[envNdx].name, name); >>>>>> + env = stpncpy(envVars[envNdx].name, name, nameLen); >>>>>> if ((envVars[envNdx].name)[nameLen] != '=') >>>>>> env = stpcpy(env, "="); >>> Microoptimized: >>> >>> env = stpncpy(envVars[envNdx].name, name, nameLen); >>> *env++ = '='; >>> >> >> In fact, I think that the currently committed code is not functionally >> broken, >> just weird. > > No. The bad thing is that current code increments "env" pointer > unpredictable (depending on junk). And the value of variable is written > to that "env" pointer later will be off by one sometimes. >
Ah, true. -- Andriy Gapon _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"