]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Re-format after recent change to fix linkhash.
authorEric Haszlakiewicz <erh+git@nimenees.com>
Sun, 10 May 2020 03:58:27 +0000 (03:58 +0000)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Sun, 10 May 2020 03:58:27 +0000 (03:58 +0000)
linkhash.c
tests/test4.c

index f930efd387100c3ba92a453a07928028e7e8acbc..b021ef10b004b99f27419ee0cf19288634945b0b 100644 (file)
@@ -580,7 +580,8 @@ int lh_table_insert_w_hash(struct lh_table *t, const void *k, const void *v, con
 {
        unsigned long n;
 
-       if (t->count >= t->size * LH_LOAD_FACTOR) {
+       if (t->count >= t->size * LH_LOAD_FACTOR)
+       {
                /* Avoid signed integer overflow with large tables. */
                int new_size = (t->size > INT_MAX / 2) ? INT_MAX : (t->size * 2);
                if (t->size == INT_MAX || lh_table_resize(t, new_size) != 0)
index fd2f3be8ecf9496343e8954b664ada7cd7a3d082..7d3d0be168f21fc2784080f21fa506785616f0f9 100644 (file)
@@ -5,8 +5,8 @@
 #include "config.h"
 #include <assert.h>
 #include <stdio.h>
-#include <string.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "json_inttypes.h"
 #include "json_object.h"
@@ -49,7 +49,6 @@ static void test_lot_of_adds()
        json_object_put(jobj);
 }
 
-
 int main(void)
 {
        const char *input = "\"\\ud840\\udd26,\\ud840\\udd27,\\ud800\\udd26,\\ud800\\udd27\"";