From: Wayne Davison Date: Wed, 30 Mar 2005 20:18:48 +0000 (+0000) Subject: Allow %i to have a field width. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/b4bf2b5a7e4c7a76b02efd7d73a7e34b2c78a664 Allow %i to have a field width. --- diff --git a/log.c b/log.c index 148d6b15..f91f7a55 100644 --- a/log.c +++ b/log.c @@ -369,7 +369,7 @@ static void log_formatted(enum logcode code, char *format, char *op, 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; @@ -456,7 +456,7 @@ static void log_formatted(enum logcode code, char *format, char *op, n = "*deleting"; break; } - n = buf2; + n = buf2 + MAXPATHLEN - 32; n[0] = iflags & ITEM_LOCAL_CHANGE ? iflags & ITEM_XNAME_FOLLOWS ? 'h' : 'c' : !(iflags & ITEM_TRANSFER) ? '.'