diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2004-02-17 18:05:38 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2004-02-17 18:05:38 +0000 |
commit | 1118351ad3803d4508a146762775a9ee1e05c09c (patch) | |
tree | 7e5d2d0183388549e1c22b3f8e2bf7bc80e0ba50 /tools | |
parent | f17bb94f47090f3397b60b5e264aa9f18dbf203d (diff) |
Replace unprintable characters for device name
Diffstat (limited to 'tools')
-rw-r--r-- | tools/hciconfig.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/hciconfig.c b/tools/hciconfig.c index 92292a20..651e1438 100644 --- a/tools/hciconfig.c +++ b/tools/hciconfig.c @@ -32,6 +32,7 @@ #include <signal.h> #include <fcntl.h> #include <errno.h> +#include <ctype.h> #include <getopt.h> #include <termios.h> @@ -369,11 +370,15 @@ void cmd_name(int ctl, int hdev, char *opt) } } else { char name[248]; + int i; if (hci_read_local_name(s, sizeof(name), name, 1000) < 0) { printf("Can't read local name on hci%d. %s(%d)\n", hdev, strerror(errno), errno); exit(1); } + for (i = 0; i < 248 && name[i]; i++) + if (!isprint(name[i])) + name[i] = '.'; print_dev_hdr(&di); printf("\tName: '%s'\n", name); } |