summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libwpactrl/wpactrl_scan_parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libwpactrl/wpactrl_scan_parse.c b/src/libwpactrl/wpactrl_scan_parse.c
index decb1cb..c97c59d 100644
--- a/src/libwpactrl/wpactrl_scan_parse.c
+++ b/src/libwpactrl/wpactrl_scan_parse.c
@@ -33,8 +33,8 @@ static int wpactrl_scan_parse_one (char const *s, size_t len, wpactrl_scanres_t
s += pos + 1 ; len -= pos + 1 ;
sr.flags_len = sa->len - sr.flags_start ;
sr.ssid_start = sa->len ;
- sr.ssid_len = len - 1 ;
- if (!stralloc_catb(sa, s, len - 1) || !stralloc_0(sa)) return 0 ;
+ sr.ssid_len = len ? len - 1 : 0 ;
+ if (!stralloc_catb(sa, s, len ? len - 1 : 0) || !stralloc_0(sa)) return 0 ;
*thing = sr ;
return 1 ;