tidy up strtok use

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2015-10-23 18:43:16 +02:00
parent 59f8475924
commit 00da72bee0
2 changed files with 5 additions and 5 deletions

View File

@ -20,16 +20,16 @@
int FAST_FUNC get_linux_version_code(void)
{
struct utsname name;
char *s, *t;
char *t;
int i, r;
uname(&name); /* never fails */
s = name.release;
t = name.release;
r = 0;
for (i = 0; i < 3; i++) {
t = strtok(s, ".");
t = strtok(t, ".");
r = r * 256 + (t ? atoi(t) : 0);
s = NULL;
t = NULL;
}
return r;
}

View File

@ -2556,7 +2556,7 @@ updatepwd(const char *dir)
new = stack_putstr(p, new);
USTPUTC('/', new);
}
p = strtok(0, "/");
p = strtok(NULL, "/");
}
if (new > lim)
STUNPUTC(new);