Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/lib/libc/string



Module Name:    src
Committed By:   kre
Date:           Thu Feb 19 13:24:32 UTC 2026

Modified Files:
        src/lib/libc/string: strtok.3

Log Message:
Added restrict to SYNOPSIS for strtok_r(), and fix broken example.

strtok_r() (and strtok() which already had it here) gained "restrict"
for their params in ISO C 99 (and then in Posix 2001).

The example code worked for the particular example given (the input
data actually used) but was hopelessly broken in general.   As part
of that (but not the actual breakage), if something defines MAXTOKENS
then allow that many tokens, not one less ... add an extra slot for
the terminating NULL.

While here, update the STANDARDS section a little.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/string/strtok.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index