Skip to content

Commit

Permalink
Fix handling of negative coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
vesim987 authored and emersion committed Aug 16, 2020
1 parent 24d30b7 commit 57ac530
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,16 +662,16 @@ static void print_formatted_result(const struct slurp_box *result,
i++; // Skip the next character (x, y, w or h)
switch (next) {
case 'x':
printf("%u", result->x);
printf("%d", result->x);
continue;
case 'y':
printf("%u", result->y);
printf("%d", result->y);
continue;
case 'w':
printf("%u", result->width);
printf("%d", result->width);
continue;
case 'h':
printf("%u", result->height);
printf("%d", result->height);
continue;
default:
// If no case was executed, revert i back - we don't need to
Expand Down

0 comments on commit 57ac530

Please sign in to comment.