From 1ab51fb595232e630d530169237833c7be0763a3 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 26 Jul 2015 16:18:40 +0300 Subject: [PATCH] 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 --- src/fst/fst_ctrl_iface.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/fst/fst_ctrl_iface.c b/src/fst/fst_ctrl_iface.c index 06bba5a55..76d4776b2 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;