summaryrefslogtreecommitdiff
path: root/modutils/lsmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'modutils/lsmod.c')
-rw-r--r--modutils/lsmod.c8
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);
}