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.

-- 
http://ache.vniz.net/
bitcoin:1G6ugdNY6e5jx1GVnAU2ntj2NEfmjKG85r
_______________________________________________
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"

Reply via email to