summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>1999-07-03 16:21:32 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>1999-07-03 16:21:32 +0000
commit434a71bd7bca8cfe74d58ff82c1c699c62e467df (patch)
treed6067950d7154bbc3fbcc86986b15f4717d02eb2 /lib
parent8c12451c61e7ab222563e3189eab05693042c5b5 (diff)
whoops, fix a bug in my example :)
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/string/strtok.34
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';