n = fmt + 1;
if (*p == '-')
*n++ = *p++;
- while (isdigit(*(uchar*)p) && n - fmt < 16)
+ while (isdigit(*(uchar*)p) && n - fmt < (int)(sizeof fmt) - 8)
*n++ = *p++;
*n = '\0';
n = NULL;
file->dir.root, n);
/* The buffer from safe_fname() has more
* room than MAXPATHLEN, so this is safe. */
- strcpy(n, buf2);
+ if (fmt[1])
+ strcpy(n, buf2);
+ else
+ n = buf2;
}
clean_fname(n, 0);
if (*n == '/')
n = "*deleting";
break;
}
- n = buf2;
+ n = buf2 + MAXPATHLEN - 32;
n[0] = iflags & ITEM_LOCAL_CHANGE
? iflags & ITEM_XNAME_FOLLOWS ? 'h' : 'c'
: !(iflags & ITEM_TRANSFER) ? '.'