Browse Source

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>
Jouni Malinen 9 years ago
parent
commit
1ab51fb595
1 changed files with 1 additions and 4 deletions
  1. 1 4
      src/fst/fst_ctrl_iface.c

+ 1 - 4
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;