summaryrefslogtreecommitdiffstats
path: root/binding
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2019-05-29 11:22:22 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2019-05-29 11:27:25 -0700
commitfcc777b2e173718600da80682f8a871913e3c399 (patch)
treeb19176864dc1d0275e7c1d400ea70a4f3b3a6d8e /binding
parentd2237bb1d53d5ee870a8ecb2601bc1daad393f3a (diff)
binding: bluetooth-pbap: parse fn correctly for UTF-8 charsethalibut_7.99.1halibut/7.99.17.99.1
Don't include CHARSET=UTF-8 or the like in the JSON output. Bug-AGL: SPEC-2392 Change-Id: I85322e710b737bdfa58fe80ff5f0bbc0e298250b Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding')
-rw-r--r--binding/bluetooth-vcard-parser.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/binding/bluetooth-vcard-parser.c b/binding/bluetooth-vcard-parser.c
index 927443a..0b63209 100644
--- a/binding/bluetooth-vcard-parser.c
+++ b/binding/bluetooth-vcard-parser.c
@@ -51,12 +51,12 @@ static const gchar *VC_PREFIXES[VC_FIELD_COUNT] = {
static void add_fn(json_object *resp, gchar *msg)
{
- gchar *name = msg + vc_len(VC_FORMATTED_NAME) + 1;
+ gchar *name = strstr(msg, ":");
- if (!name)
- name = "UNKNOWN";
+ if (!name || !strlen(name + 1))
+ return;
- json_object_object_add(resp, "fn", json_object_new_string(name));
+ json_object_object_add(resp, "fn", json_object_new_string(++name));
}
static void add_phone(json_object *array, gchar *msg)