#ifndef lint
static const char rcsid[] =
- "$Id: dirs.c,v 1.19 2002/06/08 07:10:37 stelian Exp $";
+ "$Id: dirs.c,v 1.21 2002/07/19 14:57:39 stelian Exp $";
#endif /* not lint */
#include <config.h>
* skipping over "." and ".."
*/
namelen = snprintf(locname, sizeof(locname), "%s/", pname);
- if (namelen >= sizeof(locname))
+ if (namelen >= (int)sizeof(locname))
namelen = sizeof(locname) - 1;
rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt);
dp = rst_readdir(dirp); /* "." */
*/
while (dp != NULL) {
locname[namelen] = '\0';
- if (namelen + dp->d_namlen >= sizeof(locname)) {
+ if (namelen + dp->d_namlen >= (int)sizeof(locname)) {
fprintf(stderr, "%s%s: name exceeds %ld char\n",
locname, dp->d_name, (long)sizeof(locname) - 1);
} else {
putent(&cvtbuf);
}
} else {
- for (loc = 0; loc < size; ) {
+ for (loc = 0; loc < (long)size; ) {
dp = (struct direct *)(buf + loc);
#ifdef DIRDEBUG
printf ("reclen = %d, namlen = %d, type = %d\n",
if (!Bcvt)
dp->d_namlen = dp->d_type;
# endif
+ if (dp->d_namlen == 0 && dp->d_type != 0)
+ dp->d_namlen = dp->d_type;
dp->d_type = DT_UNKNOWN;
}
#ifdef DIRDEBUG