# HG changeset patch # User Mike Becker # Date 1551173650 -3600 # Node ID 4b84437b2167ae04a41cab40150b9140b80b7a04 # Parent 893a659768b37d25e86f85ac1fa858c17af530d7 fixes format string containing the NUL character instead of printing the NUL character in get_random_name() diff -r 893a659768b3 -r 4b84437b2167 dav/sync.c --- a/dav/sync.c Tue Feb 26 10:29:14 2019 +0100 +++ b/dav/sync.c Tue Feb 26 10:34:10 2019 +0100 @@ -2110,7 +2110,7 @@ dav_rand_bytes(name_prefix, 8); char *pre = util_hexstr(name_prefix, 8); int64_t ts = (int64_t)time(NULL); - int w = snprintf(buf, len, "%s-%"PRId64"\0", pre, ts); + int w = snprintf(buf, len, "%s-%"PRId64"%c", pre, ts, '\0'); free(pre); return w >= len; }