summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c5594df)
raw | patch | inline | side by side (parent: c5594df)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 23 Apr 2016 09:13:02 +0000 (11:13 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 23 Apr 2016 09:16:32 +0000 (11:16 +0200) |
[src/processes.c:1042]: (style) Array index 'name_start_pos' is used before limits check.
src/processes.c | patch | blob | history |
diff --git a/src/processes.c b/src/processes.c
index 5a795b5aefd915a5e4c1faeb072c63ebc3e2dfa0..03b44b58d740b0359a8e9dfb876cd6095117dcf1 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
* strchr(3) and strrchr(3) to avoid pointer arithmetic which would
* otherwise be required to determine name_len. */
name_start_pos = 0;
- while ((buffer[name_start_pos] != '(')
- && (name_start_pos < buffer_len))
+ while (name_start_pos < buffer_len && buffer[name_start_pos] != '(')
name_start_pos++;
name_end_pos = buffer_len;
- while ((buffer[name_end_pos] != ')')
- && (name_end_pos > 0))
+ while (name_end_pos > 0 && buffer[name_end_pos] != ')')
name_end_pos--;
/* Either '(' or ')' is not found or they are in the wrong order.