Skip to content
Snippets Groups Projects
Commit 09b21573 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Attempt to silence false positive warning.

The warning suggests that x1 and y1 may be uninitialized in the i > 0
block, but that's not really possible...

It's too bad the warning doesn't clarify.  It's also weird that the
warning was in the draw_line() call and not in the lines above that
(incorrectly) compared them with -1.

Fix that check while we're here.
parent a97b1ada
No related branches found
No related tags found
No related merge requests found
Pipeline #7968 passed
...@@ -11238,6 +11238,9 @@ do_rip_command(int level, int sublevel, int cmd, const char *rawargs) ...@@ -11238,6 +11238,9 @@ do_rip_command(int level, int sublevel, int cmd, const char *rawargs)
break; break;
fg = map_rip_color(rip.color); fg = map_rip_color(rip.color);
arg1 = parse_mega(&args[0], 2); arg1 = parse_mega(&args[0], 2);
// TODO: Does this draw a point if there's a single point?
if (arg1 < 1)
break;
for (i = 0; i < arg1; i++) { for (i = 0; i < arg1; i++) {
if (i == 0) { if (i == 0) {
x1 = parse_mega(&args[2], 2); x1 = parse_mega(&args[2], 2);
...@@ -11261,10 +11264,10 @@ do_rip_command(int level, int sublevel, int cmd, const char *rawargs) ...@@ -11261,10 +11264,10 @@ do_rip_command(int level, int sublevel, int cmd, const char *rawargs)
} }
if (i > 0) { if (i > 0) {
x2 = parse_mega(&args[2], 2); x2 = parse_mega(&args[2], 2);
if (x1 == -1) if (x2 == -1)
break; break;
y2 = parse_mega(&args[4], 2); y2 = parse_mega(&args[4], 2);
if (y1 == -1) if (y2 == -1)
break; break;
draw_line(x1, y1, x2, y2, true); draw_line(x1, y1, x2, y2, true);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment