Fix another issues in json/query for Sdb

This commit is contained in:
pancake 2014-08-07 03:50:39 +02:00
parent 45f5a3d31f
commit 71aa477291
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ SDB_API int sdb_json_set (Sdb *s, const char *k, const char *p, const char *v, u
ut32 c;
char *js = sdb_get (s, k, &c);
if (!js) {
char *b = malloc (strlen (k)+strlen (v)+8);
char *b = malloc (strlen (p)+strlen (v)+8);
if (b) {
int is_str = isstring (v);
const char *q = is_str?"\"":"";

View File

@ -92,7 +92,7 @@ static int foreach_list_cb(void *user, const char *k, const char *v) {
vlen = strlen (v);
if (root) {
rlen = strlen (root);
line = malloc (klen + vlen + rlen + 2);
line = malloc (klen + vlen + rlen + 3);
memcpy (line, root, rlen);
line[rlen]='/'; /*append the '/' at the end of the namespace */
memcpy (line+rlen+1, k, klen);