This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Ensure zero termination in string/test-s*.c (was Re:segfault in test-strcmp)


> strncpy, strncmp, strncat take a source that is described in C99 as an
> "array", not a string, so need not be terminated.  (Though in the absence
> of a null character strncmp might compare up to n characters even though
> the first difference is much earlier.)

Indeed so, and since this is purpose of strn* interfaces it seems wise to
have the testers cover the unterminated permutations as well.  The problems
that arose with the new test programs so far were in the testers for
functions that require strings (strchr, strcmp).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]