]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Use strdup instead of strndup in test1.c, there's no need for the latter because...
authorEric Haszlakiewicz <erh+git@nimenees.com>
Fri, 3 Feb 2017 17:10:27 +0000 (17:10 +0000)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Fri, 3 Feb 2017 17:10:27 +0000 (17:10 +0000)
tests/test1.c

index b093df7475ba9e76016e6993756278d763b04b66..68706cb9081e3c64dbe1abf7a4a46a23dba99154 100644 (file)
@@ -35,7 +35,7 @@ static const char *to_json_string(json_object *obj, int flags)
        const char *result;
 
        result = json_object_to_json_string_length(obj, flags, &length);
-       copy = strndup(result, length);
+       copy = strdup(result);
        if (copy == NULL)
                printf("to_json_string: Allocation failed!\n");
        else {