From 0cf29634f36160c69d2759456315df878793e23f Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Sun, 12 May 2019 03:52:02 -0700 Subject: binding: bluetooth-map: remove training newline from message parsing Bug-AGL: SPEC-2351 SPEC-2392 Change-Id: I17713334bfcf941a9d766acb34cdde7c26fcf701 Signed-off-by: Matt Ranostay --- binding/bluetooth-map-bmessage.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/binding/bluetooth-map-bmessage.c b/binding/bluetooth-map-bmessage.c index 146c7db..ab51b51 100644 --- a/binding/bluetooth-map-bmessage.c +++ b/binding/bluetooth-map-bmessage.c @@ -151,6 +151,9 @@ static gboolean __bmessage_parse(gchar **msg, json_object *jresp) expect(&msg, "END:BENV", NULL); expect(&msg, "END:BMSG", NULL); + // remove trailing \n + message->str[message->len - 1] = '\0'; + json_object_object_add(jresp, "message", json_object_new_string(message->str)); g_string_free(message, TRUE); -- cgit 1.2.3-korg