summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--binding/bluetooth-map-bmessage.c3
1 files changed, 3 insertions, 0 deletions
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);