[Toybox] ls segfault

Felix Janda felix.janda at posteo.de
Sat Jun 29 14:11:26 PDT 2013


ls segfaults if there is only one file to display. The problem seems to be:

static void listfiles(int dirfd, struct dirtree *indir)
{
...
  for (ul = 0; ul<dtlen; ul++) {
    unsigned curcol;
...
    // Pad columns
    if (flags & (FLAG_C|FLAG_x)) {
      curcol = colsizes[curcol] - *len;
      if (curcol >= 0) xprintf("%s", toybuf+255-curcol);
    }
...

Felix



More information about the Toybox mailing list