aboutsummaryrefslogtreecommitdiffstats
path: root/src/wps
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-04-07 12:43:32 (GMT)
committerJouni Malinen <j@w1.fi>2015-04-22 08:44:19 (GMT)
commit0f5acfba06742617bd26ccc1b7586b399d00bef2 (patch)
tree2a42ad4f9f1d592a5ff0832ff6e1ff1b5d20f708 /src/wps
parentf371869a961ce438fe92111c6bfb96311d9d8d15 (diff)
downloadhostap-0f5acfba06742617bd26ccc1b7586b399d00bef2.zip
hostap-0f5acfba06742617bd26ccc1b7586b399d00bef2.tar.gz
hostap-0f5acfba06742617bd26ccc1b7586b399d00bef2.tar.bz2
Use common is_ctrl_char() helper function
This modifies couple of code segments that replaced control characters in strings with '_' to use a common helper function. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/wps')
-rw-r--r--src/wps/wps.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wps/wps.c b/src/wps/wps.c
index 2c68be8..498f11f 100644
--- a/src/wps/wps.c
+++ b/src/wps/wps.c
@@ -618,7 +618,8 @@ int wps_attr_text(struct wpabuf *data, char *buf, char *end)
if (str == NULL)
return pos - buf;
for (i = 0; i < attr.dev_name_len; i++) {
- if (attr.dev_name[i] < 32)
+ if (attr.dev_name[i] == 0 ||
+ is_ctrl_char(attr.dev_name[i]))
str[i] = '_';
else
str[i] = attr.dev_name[i];