diff options
author | 1999-07-03 16:21:31 +0000 | |
---|---|---|
committer | 1999-07-03 16:21:31 +0000 | |
commit | f86f8fbce00f5d97d7cd539328f65d5f6eb827aa (patch) | |
tree | 65205b29ba483abde56945e5d1614a2b67932d6f /lib/libc/string/strtok.3 | |
parent | add an example (diff) | |
download | wireguard-openbsd-f86f8fbce00f5d97d7cd539328f65d5f6eb827aa.tar.xz wireguard-openbsd-f86f8fbce00f5d97d7cd539328f65d5f6eb827aa.zip |
whoops, fix a bug in my example :)
Diffstat (limited to 'lib/libc/string/strtok.3')
-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'; |