From: wu zheng Date: Wed, 14 Jan 2015 07:13:47 +0000 (+0800) Subject: Fix the length of string X-Git-Tag: submit/tizen/20150114.072658^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F22%2F33722%2F1;p=platform%2Fupstream%2Fbluez.git Fix the length of string When string is char *, the length need to be set. Change-Id: I8659442afe939af56ca0fe224cf145012197e8ba Signed-off-by: Wu Zheng --- diff --git a/tools/hcitool.c b/tools/hcitool.c index ee810e5..da38052 100644 --- 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); }