Mercurial > hg > toybox
comparison toys/posix/ls.c @ 937:871c68a35e95
Fix another segfault in ls -C when terminal size is 0x0.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 30 Jun 2013 01:26:56 -0500 |
parents | b92cb3cc9696 |
children | b58e86e366ab |
comparison
equal
deleted
inserted
replaced
936:859a93658467 | 937:871c68a35e95 |
---|---|
373 if (et) xputc(et); | 373 if (et) xputc(et); |
374 | 374 |
375 // Pad columns | 375 // Pad columns |
376 if (flags & (FLAG_C|FLAG_x)) { | 376 if (flags & (FLAG_C|FLAG_x)) { |
377 curcol = colsizes[curcol] - *len; | 377 curcol = colsizes[curcol] - *len; |
378 if (curcol >= 0) xprintf("%s", toybuf+255-curcol); | 378 if (curcol < 255) xprintf("%s", toybuf+255-curcol); |
379 } | 379 } |
380 } | 380 } |
381 | 381 |
382 if (width) xputc('\n'); | 382 if (width) xputc('\n'); |
383 | 383 |