summaryrefslogtreecommitdiffstats
path: root/tools/hciconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/hciconfig.c')
-rw-r--r--tools/hciconfig.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index 4dfb57a7..ca44831f 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -437,7 +437,7 @@ static void cmd_name(int ctl, int hdev, char *opt)
exit(1);
}
} else {
- char name[248];
+ char name[249];
int i;
if (hci_read_local_name(s, sizeof(name), name, 1000) < 0) {
fprintf(stderr, "Can't read local name on hci%d: %s (%d)\n",
@@ -447,6 +447,7 @@ static void cmd_name(int ctl, int hdev, char *opt)
for (i = 0; i < 248 && name[i]; i++)
if (!isprint(name[i]))
name[i] = '.';
+ name[248] = '\0';
print_dev_hdr(&di);
printf("\tName: '%s'\n", name);
}