Skip to content

Commit 13b67f1

Browse files
davvidgitster
authored andcommitted
xdiff: avoid signed vs. unsigned comparisons in xpatience.c
The loop iteration variable is non-negative and used in comparisons against a size_t value. Use size_t to eliminate the mismatch. Signed-off-by: David Aguilar <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2dc6cf2 commit 13b67f1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

xdiff/xpatience.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
*
2121
*/
2222

23-
#define DISABLE_SIGN_COMPARE_WARNINGS
24-
2523
#include "xinclude.h"
2624

2725
/*
@@ -78,7 +76,7 @@ struct hashmap {
7876

7977
static int is_anchor(xpparam_t const *xpp, const char *line)
8078
{
81-
int i;
79+
size_t i;
8280
for (i = 0; i < xpp->anchors_nr; i++) {
8381
if (!strncmp(line, xpp->anchors[i], strlen(xpp->anchors[i])))
8482
return 1;

0 commit comments

Comments
 (0)