fix(coverity/508289): lookup_colour() dead code

Problem:
Dead code due to CSI arg guard resulting in argcount never zero.

Solution:
Invert guard to avoid repeating return statements.
This commit is contained in:
Devon Gardner 2024-09-09 21:26:17 -04:00 committed by Devon Gardner
parent 4c5bce9cb4
commit 9143c1f15b

View File

@ -100,10 +100,7 @@ static int lookup_colour(const VTermState *state, int palette, const long args[]
return 3;
case 5: // XTerm 256-colour mode
if (!argcount || CSI_ARG_IS_MISSING(args[0])) {
return argcount ? 1 : 0;
}
if (argcount && !CSI_ARG_IS_MISSING(args[0]))
vterm_color_indexed(col, args[0]);
return argcount ? 1 : 0;