[TSAN] Fix infinite loop on targets where char is unsigned

For targets where char is unsigned (like PowerPC), something like
char c = fgetc(...) will never produce a char that will compare
equal to EOF so this loop does not terminate.
Change the type to int (which appears to be the POSIX return type
for fgetc).
This allows the test case to terminate normally on PPC.
This commit is contained in:
Nemanja Ivanovic
2020-04-11 07:08:05 -05:00
parent 89f6ca05b7
commit 7cc6d0cc90

View File

@@ -13,7 +13,7 @@ long count_memory_mappings() {
FILE *proc_file = fopen(proc_file_name, "r");
long line_count = 0;
char c;
int c;
do {
c = fgetc(proc_file);
if (c == '\n') {