Skip to content

Commit 3063477

Browse files
tboegigitster
authored andcommitted
path.c: char is not (always) signed
If a "char" in C is signed or unsigned is not specified, because it is out of tradition "implementation dependent". Therefore constructs like "if (name[i] < 0)" are not portable, use "if (name[i] & 0x80)" instead. Detected by "gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516" when setting DEVELOPER = 1 DEVOPTS = extra-all Signed-off-by: Torsten Bögershausen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6e9e91e commit 3063477

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

path.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ static int is_ntfs_dot_generic(const char *name,
13681368
saw_tilde = 1;
13691369
} else if (i >= 6)
13701370
return 0;
1371-
else if (name[i] < 0) {
1371+
else if (name[i] & 0x80) {
13721372
/*
13731373
* We know our needles contain only ASCII, so we clamp
13741374
* here to make the results of tolower() sane.

0 commit comments

Comments
 (0)