uloop: fix build using C++ compilers
[project/libubox.git] / json_script.c
index 14d045db19a8818b2d5e75b17d9a0f38a6811727..7177e9cb12e605bd716fad9147c34cc817422b6a 100644 (file)
@@ -431,7 +431,7 @@ static int eval_string(struct json_call *call, struct blob_buf *buf, const char
        bool var = false;
        char c = '%';
 
-       dest = blobmsg_alloc_string_buffer(buf, name, 1);
+       dest = blobmsg_alloc_string_buffer(buf, name, 0);
        if (!dest)
                return -1;
 
@@ -473,7 +473,7 @@ static int eval_string(struct json_call *call, struct blob_buf *buf, const char
                        cur_len = end - str;
                }
 
-               new_buf = blobmsg_realloc_string_buffer(buf, len + cur_len + 1);
+               new_buf = blobmsg_realloc_string_buffer(buf, len + cur_len);
                if (!new_buf) {
                        /* Make eval_string return -1 */
                        var = true;