ps: work around libc bug: printf("%.*s\n", MAX_INT, buffer)

This commit is contained in:
Denis Vlasenko
2007-03-28 21:57:12 +00:00
parent b7cffd4bed
commit 450196c119
2 changed files with 6 additions and 4 deletions

View File

@@ -262,7 +262,9 @@ int ps_main(int argc, char **argv)
parse_o(default_o);
post_process();
terminal_width = INT_MAX;
/* Was INT_MAX, but some libc's go belly up with printf("%.*s")
* and such large widths */
terminal_width = 30000;
if (isatty(1)) {
get_terminal_width_height(1, &terminal_width, NULL);
terminal_width--;