OSDN Git Service

Only send first 16 characters of operator name in +COPS.
authorSharvil Nanavati <sharvil@google.com>
Tue, 5 Jan 2016 01:15:18 +0000 (17:15 -0800)
committerSharvil Nanavati <sharvil@google.com>
Tue, 5 Jan 2016 01:33:53 +0000 (17:33 -0800)
According to the HFP spec, the operator name is required to be at
most 16 characters long.

Bug: 24871011
Change-Id: I9987de57a327348fc2203b9502e9df446a87793f

btif/src/btif_hf.c

index aef259d..4987bbe 100644 (file)
@@ -1047,7 +1047,7 @@ static bt_status_t cops_response(const char *cops, bt_bdaddr_t *bd_addr)
         tBTA_AG_RES_DATA    ag_res;
 
         /* Format the response */
-        sprintf (ag_res.str, "0,0,\"%s\"", cops);
+        sprintf (ag_res.str, "0,0,\"%.16s\"", cops);
         ag_res.ok_flag = BTA_AG_OK_DONE;
 
         BTA_AgResult (btif_hf_cb[idx].handle, BTA_AG_COPS_RES, &ag_res);