diff options
author | José Bollo <jose.bollo@iot.bzh> | 2018-07-24 11:47:44 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2018-07-24 16:28:32 +0200 |
commit | 77ca8b40f2d0c8b1cbf9960bd5a5b2aec36fef38 (patch) | |
tree | 90a0206c748dde157460dce3524bf88f49552ed6 /src/afb-export.c | |
parent | e17ae412245ba9afb33ff6a0f1f665b4d66d4da4 (diff) |
json-c: Remove escaping of slashs
By default json-c escapes the slashes. This is almost ugly
and unuseful. But the resolution (with JSON_C_TO_STRING_NOSLASHESCAPE)
was introduced lately by json-c. Integrate it as much as possible.
Change-Id: Ia9c4bee78dc11df1ee9640cb04311991bd860e43
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-export.c')
-rw-r--r-- | src/afb-export.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/afb-export.c b/src/afb-export.c index b40dd079..811ecb5e 100644 --- a/src/afb-export.c +++ b/src/afb-export.c @@ -24,6 +24,9 @@ #include <ctype.h> #include <json-c/json.h> +#if !defined(JSON_C_TO_STRING_NOSLASHESCAPE) +#define JSON_C_TO_STRING_NOSLASHESCAPE 0 +#endif #define AFB_BINDING_VERSION 0 #include <afb/afb-binding.h> @@ -252,7 +255,8 @@ static int event_broadcast_cb(struct afb_api_x3 *closure, const char *name, stru /* check daemon state */ if (export->state == Api_State_Pre_Init) { - ERROR("[API %s] Bad call to 'afb_daemon_event_broadcast(%s, %s)', must not be in PreInit", export->api.apiname, name, json_object_to_json_string(object)); + ERROR("[API %s] Bad call to 'afb_daemon_event_broadcast(%s, %s)', must not be in PreInit", + export->api.apiname, name, json_object_to_json_string_ext(object, JSON_C_TO_STRING_NOSLASHESCAPE)); errno = EINVAL; return 0; } |