]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: Do not slash escape strings in JSON output
authorDaniel Wagner <dwagner@suse.de>
Thu, 17 Mar 2022 14:32:26 +0000 (15:32 +0100)
committerDaniel Wagner <dwagner@suse.de>
Thu, 17 Mar 2022 14:32:26 +0000 (15:32 +0100)
nvme-cli 1.x didn't do any (optional) slash escaping in JSON
output. Don't break backwards compatibility unnecessary.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
nvme.h

diff --git a/nvme.h b/nvme.h
index 66ab46a36937beed9e4787176ec5710940f0c7dc..6dc6ad1c8f9a0ae50d5544677978fa552daa87ae 100644 (file)
--- a/nvme.h
+++ b/nvme.h
@@ -57,7 +57,9 @@
 #define json_array_add_value_string(o, v) \
        json_object_array_add(o, json_object_new_string(v))
 #define json_print_object(o, u)                                                \
-       printf("%s", json_object_to_json_string_ext(o, JSON_C_TO_STRING_PRETTY))
+       printf("%s", json_object_to_json_string_ext(o,                  \
+               JSON_C_TO_STRING_PRETTY |                               \
+               JSON_C_TO_STRING_NOSLASHESCAPE))
 #else
 #include "util/json.h"
 #endif