summaryrefslogtreecommitdiffstats
path: root/nsprpub/lib/libc/src/strtok.c
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:01:38 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:01:38 +0100
commitf7d30133221896638f7bf4f66c504255c4b14f48 (patch)
tree5f3e07a049f388a3a309a615b8884318f6668a98 /nsprpub/lib/libc/src/strtok.c
parent26b297510a11758727438df4669357a2a2bc42ce (diff)
downloadUXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.gz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.lz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.xz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.zip
Issue #1338 - Part 1: Update NSPR to 4.24
Diffstat (limited to 'nsprpub/lib/libc/src/strtok.c')
-rw-r--r--nsprpub/lib/libc/src/strtok.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/nsprpub/lib/libc/src/strtok.c b/nsprpub/lib/libc/src/strtok.c
index 2daaea36c..df404494f 100644
--- a/nsprpub/lib/libc/src/strtok.c
+++ b/nsprpub/lib/libc/src/strtok.c
@@ -14,21 +14,24 @@ PL_strtok_r(char *s1, const char *s2, char **lasts)
if( s1 == NULL )
{
- if( *lasts == NULL )
+ if( *lasts == NULL ) {
return NULL;
+ }
s1 = *lasts;
}
-
+
for( ; (c = *s1) != 0; s1++ )
{
for( sepp = s2 ; (sc = *sepp) != 0 ; sepp++ )
{
- if( c == sc )
+ if( c == sc ) {
break;
+ }
+ }
+ if( sc == 0 ) {
+ break;
}
- if( sc == 0 )
- break;
}
if( c == 0 )
@@ -36,7 +39,7 @@ PL_strtok_r(char *s1, const char *s2, char **lasts)
*lasts = NULL;
return NULL;
}
-
+
tok = s1++;
for( ; (c = *s1) != 0; s1++ )