Allow %i to have a field width.
authorWayne Davison <wayned@samba.org>
Wed, 30 Mar 2005 20:18:48 +0000 (20:18 +0000)
committerWayne Davison <wayned@samba.org>
Wed, 30 Mar 2005 20:18:48 +0000 (20:18 +0000)
log.c

diff --git a/log.c b/log.c
index 148d6b1..f91f7a5 100644 (file)
--- 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) ? '.'