diff options
-rw-r--r-- | toys/posix/uname.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/toys/posix/uname.c b/toys/posix/uname.c index 2e17d387..a1338415 100644 --- a/toys/posix/uname.c +++ b/toys/posix/uname.c @@ -41,12 +41,13 @@ config UNAME void uname_main(void) { int i, flags = toys.optflags, needspace=0; + struct utsname u; - uname((void *)toybuf); + uname(&u); if (!flags) flags = FLAG_s; for (i=0; i<5; i++) { - char *c = toybuf+(65*i); + char *c = ((char *) &u)+(sizeof(u.sysname)*i); if (flags & ((1<<i)|FLAG_a)) { int len = strlen(c); |