FST: Merge unreachable error case to another error return
authorJouni Malinen <j@w1.fi>
Sun, 26 Jul 2015 13:18:40 +0000 (16:18 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 26 Jul 2015 15:45:13 +0000 (18:45 +0300)
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>
src/fst/fst_ctrl_iface.c

index 06bba5a..76d4776 100644 (file)
@@ -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;