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