Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Optimized '%f' a little more.
[rsync/rsync.git]
/
log.c
diff --git
a/log.c
b/log.c
index
148d6b1
..
c6d2fc8
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++;
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;
*n++ = *p++;
*n = '\0';
n = NULL;
@@
-397,7
+397,10
@@
static void log_formatted(enum logcode code, char *format, char *op,
file->dir.root, n);
/* The buffer from safe_fname() has more
* room than MAXPATHLEN, so this is safe. */
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 == '/')
}
clean_fname(n, 0);
if (*n == '/')
@@
-456,7
+459,7
@@
static void log_formatted(enum logcode code, char *format, char *op,
n = "*deleting";
break;
}
n = "*deleting";
break;
}
- n = buf2;
+ n = buf2
+ MAXPATHLEN - 32
;
n[0] = iflags & ITEM_LOCAL_CHANGE
? iflags & ITEM_XNAME_FOLLOWS ? 'h' : 'c'
: !(iflags & ITEM_TRANSFER) ? '.'
n[0] = iflags & ITEM_LOCAL_CHANGE
? iflags & ITEM_XNAME_FOLLOWS ? 'h' : 'c'
: !(iflags & ITEM_TRANSFER) ? '.'