[git commit] tidy up strtok use
Denys Vlasenko
vda.linux at googlemail.com
Fri Oct 23 16:43:16 UTC 2015
commit: http://git.busybox.net/busybox/commit/?id=00da72bee09cfe4a757cbba4465a76269dae9f43
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
libbb/kernel_version.c | 8 ++++----
shell/ash.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/libbb/kernel_version.c b/libbb/kernel_version.c
index 738ed02..9b6c622 100644
--- a/libbb/kernel_version.c
+++ b/libbb/kernel_version.c
@@ -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;
}
diff --git a/shell/ash.c b/shell/ash.c
index 8a1628e..17121aa 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -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);
More information about the busybox-cvs
mailing list