char *head, *tail, *result;
tail = strchr(path, '/');
- head = strndup(path, tail ? tail - path : strlen(path));
+ head = strndup(path, tail ? (size_t)(tail - path) : strlen(path));
int res = glob(head, GLOB_TILDE, NULL, &globbuf);
free(head);
char *store_restart_layout(void) {
setlocale(LC_NUMERIC, "C");
-#if YAJL_MAJOR >= 2
yajl_gen gen = yajl_gen_alloc(NULL);
-#else
- yajl_gen gen = yajl_gen_alloc(NULL, NULL);
-#endif
dump_node(gen, croot, true);
setlocale(LC_NUMERIC, "");
const unsigned char *payload;
-#if YAJL_MAJOR >= 2
size_t length;
-#else
- unsigned int length;
-#endif
y(get_buf, &payload, &length);
/* create a temporary file if one hasn't been specified, or just
return NULL;
}
written += n;
-#if YAJL_MAJOR >= 2
DLOG("written: %zd of %zd\n", written, length);
-#else
- DLOG("written: %d of %d\n", written, length);
-#endif
}
close(fd);