From c4201e8a49fce923acce53c36a7cfe4d07c0ed9b Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Fri, 3 Jan 2014 21:55:21 -0400 Subject: [PATCH] core: Fix sscanf() format specification Also change the type of the "handle" variable so it is compatible with the "%hu" specification used for sprintf() on the same function. Fixes clang error: src/adapter.c:3550:24: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat] --- src/adapter.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index 948010387..230f3ce41 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -3515,16 +3515,16 @@ static void convert_ccc_entry(char *key, char *value, void *user_data) char *src_addr = user_data; char dst_addr[18]; char type = BDADDR_BREDR; - int handle, ret; + uint16_t handle; + int ret, err; char filename[PATH_MAX + 1]; GKeyFile *key_file; struct stat st; - int err; char group[6]; char *data; gsize length = 0; - ret = sscanf(key, "%17s#%hhu#%04X", dst_addr, &type, &handle); + ret = sscanf(key, "%17s#%hhu#%04hX", dst_addr, &type, &handle); if (ret < 3) return; @@ -3565,16 +3565,16 @@ static void convert_gatt_entry(char *key, char *value, void *user_data) char *src_addr = user_data; char dst_addr[18]; char type = BDADDR_BREDR; - int handle, ret; + uint16_t handle; + int ret, err; char filename[PATH_MAX + 1]; GKeyFile *key_file; struct stat st; - int err; char group[6]; char *data; gsize length = 0; - ret = sscanf(key, "%17s#%hhu#%04X", dst_addr, &type, &handle); + ret = sscanf(key, "%17s#%hhu#%04hX", dst_addr, &type, &handle); if (ret < 3) return; -- 2.47.3