C programming hint

Ed Hirgelt ed at zinfandel.UUCP
Sat Jul 13 07:06:59 AEST 1985


I may be mistaken, but this hint also has a problem in not null
terminating the string. strncpy stops at the first null character
or when the count is exceeded. Since the initial version of the
string has no null, one is never added to the string. This may
be what the poster intended, but he should never use that string
with any of the other string utilities (like strcmp, etc.)
-- 
Ed Hirgelt
Zehntel Automation Systems	{ihnp4 ucbvax}!zehntel!ed
2625 Shadelands Drive		zehntel!ed at Berkeley.ARPA
Walnut Creek, Ca 94598



More information about the Comp.lang.c mailing list