summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2002-06-22 18:13:05 +0000
committerderaadt <deraadt@openbsd.org>2002-06-22 18:13:05 +0000
commit4cd4f947543ba399d151320f57d67e58338d23b0 (patch)
treede0c3f8116931a98b75dc3102405cf7e0fc51c71
parentuse process ID vs. pid/PID/process identifier (diff)
downloadwireguard-openbsd-4cd4f947543ba399d151320f57d67e58338d23b0.tar.xz
wireguard-openbsd-4cd4f947543ba399d151320f57d67e58338d23b0.zip
use strtok_r
-rw-r--r--lib/libcurses/tty/hardscroll.c8
-rw-r--r--lib/libcurses/tty/hashmap.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/libcurses/tty/hardscroll.c b/lib/libcurses/tty/hardscroll.c
index 7673cffa9c3..c143201465e 100644
--- a/lib/libcurses/tty/hardscroll.c
+++ b/lib/libcurses/tty/hardscroll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hardscroll.c,v 1.3 2001/01/22 18:01:59 millert Exp $ */
+/* $OpenBSD: hardscroll.c,v 1.4 2002/06/22 18:13:05 deraadt Exp $ */
/****************************************************************************
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
@@ -287,7 +287,7 @@ _nc_linedump(void)
int
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
- char line[BUFSIZ], *st;
+ char line[BUFSIZ], *st, *last;
#ifdef TRACE
_nc_tracing = TRACE_MOVE;
@@ -308,11 +308,11 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
(void) fputs(line, stderr);
continue;
}
- st = strtok(line, " ");
+ st = strtok_r(line, " ", &last);
do {
oldnums[n++] = atoi(st);
} while
- ((st = strtok((char *) NULL, " ")) != 0);
+ ((st = strtok_r((char *) NULL, " ", &last)) != 0);
/* display it */
(void) fputs("Initial input:\n", stderr);
diff --git a/lib/libcurses/tty/hashmap.c b/lib/libcurses/tty/hashmap.c
index c57e36527cd..bf57cefdbe2 100644
--- a/lib/libcurses/tty/hashmap.c
+++ b/lib/libcurses/tty/hashmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hashmap.c,v 1.6 2001/01/22 18:01:59 millert Exp $ */
+/* $OpenBSD: hashmap.c,v 1.7 2002/06/22 18:13:05 deraadt Exp $ */
/****************************************************************************
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
@@ -448,7 +448,7 @@ usage(void)
int
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
- char line[BUFSIZ], *st;
+ char line[BUFSIZ], *st, *last;
int n;
SP = typeCalloc(SCREEN, 1);
@@ -480,11 +480,11 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
oldnums[n] = _NEWINDEX;
}
n = 0;
- st = strtok(line, " ");
+ st = strtok_r(line, " ", &last);
do {
oldnums[n++] = atoi(st);
} while
- ((st = strtok((char *) NULL, " ")) != 0);
+ ((st = strtok_r((char *) NULL, " "), &last) != 0);
break;
case 'n': /* use following letters as text of new lines */