dav/sync.c

changeset 516
39f5f17c3bc3
parent 514
4b84437b2167
child 521
c5bbae4b3cca
equal deleted inserted replaced
515:2465dd550bb5 516:39f5f17c3bc3
2108 unsigned char name_prefix[8]; 2108 unsigned char name_prefix[8];
2109 memset(name_prefix, 0, 8); 2109 memset(name_prefix, 0, 8);
2110 dav_rand_bytes(name_prefix, 8); 2110 dav_rand_bytes(name_prefix, 8);
2111 char *pre = util_hexstr(name_prefix, 8); 2111 char *pre = util_hexstr(name_prefix, 8);
2112 int64_t ts = (int64_t)time(NULL); 2112 int64_t ts = (int64_t)time(NULL);
2113 int w = snprintf(buf, len, "%s-%"PRId64"%c", pre, ts, '\0'); 2113 int w = snprintf(buf, len, "%"PRId64"-%s", ts, pre);
2114 free(pre); 2114 free(pre);
2115 return w >= len; 2115 return w >= len;
2116 } 2116 }
2117 2117
2118 #define VBEGIN_ERROR_MKCOL 1 2118 #define VBEGIN_ERROR_MKCOL 1

mercurial