s->pid, s->user, s->state, rss_str_buf, s->ppid,
pmem/10, pmem%10);
#endif
- if((int)strlen(namecmd) > col)
- namecmd[col] = 0;
- printf("%s\n", namecmd);
+ if((int)strlen(namecmd) > col)
+ namecmd[col] = 0;
+ printf("%s", namecmd);
+ if(count)
+ putchar('\n');
+ else
+ fflush(stdout);
s++;
}
}
get_terminal_width_height(0, &col, &lines);
if (lines > 4) {
- lines -= 5;
+ lines -= 4;
#ifdef CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE
col = col - 80 + 35 - 6;
#else
return EXIT_FAILURE;
}
if(c == 'q' || c == initial_settings.c_cc[VINTR])
- return EXIT_SUCCESS;
+ break;
if(c == 'M') {
#ifdef CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE
sort_function[0] = mem_sort;
#endif /* CONFIG_FEATURE_USE_TERMIOS */
clearmems();
}
-
+ if(ENABLE_FEATURE_CLEAN_UP)
+ clearmems();
+ putchar('\n');
return EXIT_SUCCESS;
}