diff options
Diffstat (limited to 'ctdb/lib/replace/snprintf.c')
-rw-r--r-- | ctdb/lib/replace/snprintf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ctdb/lib/replace/snprintf.c b/ctdb/lib/replace/snprintf.c index 9f8a7657e5..bca774263e 100644 --- a/ctdb/lib/replace/snprintf.c +++ b/ctdb/lib/replace/snprintf.c @@ -504,6 +504,7 @@ static int dopr(char *buffer, size_t maxlen, const char *format, va_list args_in break; case 'p': cnk->type = CNK_PTR; + cnk->flags |= DP_F_UNSIGNED; break; case 'n': cnk->type = CNK_NUM; @@ -526,7 +527,7 @@ static int dopr(char *buffer, size_t maxlen, const char *format, va_list args_in } } - /* retieve the format arguments */ + /* retrieve the format arguments */ for (pnum = 0; pnum < max_pos; pnum++) { int i; @@ -1264,7 +1265,7 @@ static int add_cnk_list_entry(struct pr_chunk_x **list, VA_COPY(ap2, ap); ret = vsnprintf(NULL, 0, format, ap2); va_end(ap2); - if (ret <= 0) return ret; + if (ret < 0) return ret; (*ptr) = (char *)malloc(ret+1); if (!*ptr) return -1; |