diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 1999-07-03 16:21:32 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 1999-07-03 16:21:32 +0000 |
commit | 434a71bd7bca8cfe74d58ff82c1c699c62e467df (patch) | |
tree | d6067950d7154bbc3fbcc86986b15f4717d02eb2 | |
parent | 8c12451c61e7ab222563e3189eab05693042c5b5 (diff) |
whoops, fix a bug in my example :)
-rw-r--r-- | lib/libc/string/strtok.3 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/string/strtok.3 b/lib/libc/string/strtok.3 index d43046ae5c4..287d1bf1315 100644 --- a/lib/libc/string/strtok.3 +++ b/lib/libc/string/strtok.3 @@ -33,7 +33,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: strtok.3,v 1.7 1999/07/03 15:58:50 aaron Exp $ +.\" $OpenBSD: strtok.3,v 1.8 1999/07/03 16:21:31 aaron Exp $ .\" .Dd June 29, 1991 .Dt STRTOK 3 @@ -97,7 +97,7 @@ int i = 0; snprintf(s, sizeof(s), "cat dog horse cow"); for ((p = strtok(s, " ")); p; (p = strtok(NULL, " ")), i++) { - if (i < MAXTOKENS) + if (i < MAXTOKENS - 1) tokens[i] = p; } tokens[i] = '\e0'; |