summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hcid/storage.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hcid/storage.c b/hcid/storage.c
index f6475134..95ca8bd3 100644
--- a/hcid/storage.c
+++ b/hcid/storage.c
@@ -114,10 +114,10 @@ int write_local_name(bdaddr_t *bdaddr, char *name)
memset(str, 0, sizeof(str));
for (i = 0; i < 248 && name[i]; i++)
- if (isprint(name[i]))
- str[i] = name[i];
- else
+ if (name[i] < 32 || name[i] == 127)
str[i] = '.';
+ else
+ str[i] = name[i];
ba2str(bdaddr, addr);
snprintf(filename, PATH_MAX, "%s/%s/config", STORAGEDIR, addr);