Fix json structures; need to use the LKEY & lHashfunc
authorWilfried Goesgens <willi@arangodb.com>
Mon, 12 Oct 2015 17:48:24 +0000 (19:48 +0200)
committerWilfried Goesgens <willi@arangodb.com>
Mon, 12 Oct 2015 17:48:24 +0000 (19:48 +0200)
libcitadel/lib/json.c

index db10cad1cfdfb4e9426e7c839be1d016d646f2d4..63fcbdcb9adf701b96f86161727cc448bf2c5634 100644 (file)
@@ -80,7 +80,7 @@ JsonValue *NewJsonArray(const char *Key, long keylen)
        Ret->Type = JSON_ARRAY;
        if (Key != NULL)
                Ret->Name = NewStrBufPlain(Key, keylen);
-       Ret->SubValues = NewHash(1, Flathash);
+       Ret->SubValues = NewHash(1, lFlathash);
        return Ret;
 }
 
@@ -177,7 +177,7 @@ void JsonArrayAppend(JsonValue *Array, JsonValue *Val)
                return; /* todo assert! */
 
        n = GetCount(Array->SubValues);
-       Put(Array->SubValues, (const char*) &n, sizeof(n), Val, DeleteJSONValue);
+       Put(Array->SubValues, LKEY(n), Val, DeleteJSONValue);
 }
 
 void JsonObjectAppend(JsonValue *Array, JsonValue *Val)