aboutsummaryrefslogtreecommitdiffstats
path: root/src/fst
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-07-26 13:18:40 (GMT)
committerJouni Malinen <j@w1.fi>2015-07-26 15:45:13 (GMT)
commit1ab51fb595232e630d530169237833c7be0763a3 (patch)
treebbadadbf3a78bf6fe521197970533a818da5ac22 /src/fst
parent54b227a1ff780c15456155dc1b56d318d673aaeb (diff)
downloadhostap-1ab51fb595232e630d530169237833c7be0763a3.zip
hostap-1ab51fb595232e630d530169237833c7be0763a3.tar.gz
hostap-1ab51fb595232e630d530169237833c7be0763a3.tar.bz2
FST: Merge unreachable error case to another error return
fst_read_next_text_param() is never called with buflen <= 1, so this separate error path is practically unreachable. Merge it with another error path to make this a bit more compact. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/fst')
-rw-r--r--src/fst/fst_ctrl_iface.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/fst/fst_ctrl_iface.c b/src/fst/fst_ctrl_iface.c
index 06bba5a..76d4776 100644
--- a/src/fst/fst_ctrl_iface.c
+++ b/src/fst/fst_ctrl_iface.c
@@ -842,13 +842,10 @@ int fst_read_next_text_param(const char *params, char *buf, size_t buflen,
size_t max_chars_to_copy;
char *cur_dest;
- if (buflen <= 1)
- return -EINVAL;
-
*endp = (char *) params;
while (isspace(**endp))
(*endp)++;
- if (!**endp)
+ if (!**endp || buflen <= 1)
return -EINVAL;
max_chars_to_copy = buflen - 1;