Then again, why do we even bother copying this to a local buffer ?  Given that we're about to xstrdup() it anyway, this merely imposes a gratuitous need to truncate !  Why not just
```
char * fname = xstrdup(globbuf.gl_pathv[i]);
```
and use that in place of fname and xstrdup(fname) below ?