Merge commit 'grg' into HEAD
[oweals/opkg-lede.git] / libopkg / sprintf_alloc.c
index 7989493aa4008425a03ca13c70814a29b66e9847..2e3200b78542e9ec776735275bb477a9174fc60a 100644 (file)
 int sprintf_alloc(char **str, const char *fmt, ...)
 {
     va_list ap;
-    int n, size = 100;
+    int n;
+    unsigned size = 100;
 
     if (!str) {
-      fprintf(stderr, "Null string pointer passed to sprintf_alloc\n");
+      opkg_msg(ERROR, "Internal error: str=NULL.\n");
       return -1;
     }
     if (!fmt) {
-      fprintf(stderr, "Null fmt string passed to sprintf_alloc\n");
+      opkg_msg(ERROR, "Internal error: fmt=NULL.\n");
       return -1;
     }