Source-Changes-HG archive

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

[src/trunk]: src/lib/libskey use strtok_r, as strtok can interfere with outsi...



details:   https://anonhg.NetBSD.org/src/rev/dec672db3b31
branches:  trunk
changeset: 533164:dec672db3b31
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sun Jun 23 12:20:10 2002 +0000

description:
use strtok_r, as strtok can interfere with outside users.

diffstat:

 lib/libskey/put.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 04b5e9283a1b -r dec672db3b31 lib/libskey/put.c
--- a/lib/libskey/put.c Sun Jun 23 08:37:36 2002 +0000
+++ b/lib/libskey/put.c Sun Jun 23 12:20:10 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: put.c,v 1.8 2000/07/06 22:30:18 mjl Exp $      */
+/*     $NetBSD: put.c,v 1.9 2002/06/23 12:20:10 itojun Exp $   */
 
 /* S/KEY v1.1b (put.c)
  *
@@ -2121,6 +2121,7 @@
   int i, p, v, l, low, high;
   char b[9];
   char input[36];
+  char *last;
 
   if (e == NULL)
     return -1;
@@ -2130,7 +2131,7 @@
   memset (out, 0, 8);
   for (i = 0, p = 0; i < 6; i++, p += 11)
   {
-    if ((word = strtok (i == 0 ? input : NULL, " ")) == NULL)
+    if ((word = strtok_r(i == 0 ? input : NULL, " ", &last)) == NULL)
       return -1;
 
     l = strlen (word);



Home | Main Index | Thread Index | Old Index