projects
/
platform
/
upstream
/
bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f4e6ea6
)
Fix the length of string
22/33722/1
author
wu zheng
<wu.zheng@intel.com>
Wed, 14 Jan 2015 07:13:47 +0000
(15:13 +0800)
committer
wu zheng
<wu.zheng@intel.com>
Wed, 14 Jan 2015 07:13:47 +0000
(15:13 +0800)
When string is char *, the length need to be set.
Change-Id: I8659442afe939af56ca0fe224cf145012197e8ba
Signed-off-by: Wu Zheng <wu.zheng@intel.com>
tools/hcitool.c
patch
|
blob
|
history
diff --git
a/tools/hcitool.c
b/tools/hcitool.c
index
ee810e5
..
da38052
100644
(file)
--- a/
tools/hcitool.c
+++ b/
tools/hcitool.c
@@
-2444,11
+2444,11
@@
static int print_advertising_devices(int dd, uint8_t filter_type)
char name_array[30];
char *name = name_array;
- memset(name, 0,
sizeof(name)
);
+ memset(name, 0,
30
);
ba2str(&info->bdaddr, addr);
eir_parse_name(info->data, info->length,
- name,
sizeof(name) - 1
);
+ name,
29
);
printf("%s %s\n", addr, name);
}