1
0
Fork 0
nvme-cli/util/json.c
Daniel Baumann 316e846c86
Merging upstream version 2.1~rc0 (Closes: #1015722).
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-02-16 12:16:19 +01:00

19 lines
304 B
C

// SPDX-License-Identifier: GPL-2.0-or-later
#include <stdio.h>
#include "json.h"
struct json_object *util_json_object_new_double(long double d)
{
struct json_object *obj;
char *str;
if (asprintf(&str, "%Lf", d) < 0)
return NULL;
obj = json_object_new_string(str);
free(str);
return obj;
}