inp_fix_ternary_operator_str(), rewrite using strchr()

This commit is contained in:
rlar 2013-10-03 11:54:58 +02:00
parent 246dc2e614
commit 4a20c45db2
1 changed files with 2 additions and 3 deletions

View File

@ -1896,9 +1896,8 @@ inp_fix_ternary_operator_str(char *line, bool all)
fprintf(stderr, "ERROR: problem parsing 'if' of ternary string %s!\n", line);
controlled_exit(EXIT_FAILURE);
}
while (*colon != ':' && *colon != '\0')
colon++;
if (*colon != ':') {
colon = strchr(colon, ':');
if (!colon) {
fprintf(stderr, "ERROR: problem parsing ternary string (finding ':') %s!\n", line);
controlled_exit(EXIT_FAILURE);
}