diff options
author | Denis Vlasenko | 2006-10-14 02:23:43 +0000 |
---|---|---|
committer | Denis Vlasenko | 2006-10-14 02:23:43 +0000 |
commit | ea62077b850076c4d7dc3cf78ebd1888928c6ddf (patch) | |
tree | 37b7584ae40b99edb5583fbc4392b62ffdadf278 /modutils/lsmod.c | |
parent | 88ca06769028e442bf873b270c176ca0e9f021f8 (diff) | |
download | busybox-ea62077b850076c4d7dc3cf78ebd1888928c6ddf.zip busybox-ea62077b850076c4d7dc3cf78ebd1888928c6ddf.tar.gz |
add open_read_close() and similar stuff
Diffstat (limited to 'modutils/lsmod.c')
-rw-r--r-- | modutils/lsmod.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modutils/lsmod.c b/modutils/lsmod.c index ac1cded..2bf4afb 100644 --- a/modutils/lsmod.c +++ b/modutils/lsmod.c @@ -147,9 +147,8 @@ int lsmod_main(int argc, char **argv) check_tainted(); #if defined(CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT) { - char line[4096]; - - while (fgets(line, sizeof(line), file)) { + char *line; + while ((line = xmalloc_fgets(file)) != NULL) { char *tok; tok = strtok(line, " \t"); @@ -175,7 +174,8 @@ int lsmod_main(int argc, char **argv) tok = ""; printf(" %s", tok); } - printf("\n"); + puts(""); + free(line); } fclose(file); } |