Commit Diff


commit - 6771d4253a7655812f9e1b5f25d98d86ec416951
commit + 924153d61966399fb9d766961f5ecceb2c97cb48
blob - 238ecb9d0ee975efd8eacc55de14b8cfb69792de
blob + 32023105af9438217a65a1bf6b821e4d225516d1
--- lib/diff_atomize_text.c
+++ lib/diff_atomize_text.c
@@ -69,7 +69,7 @@ diff_data_atomize_text_lines_fd(struct diff_data *d)
 			while (eol == 0 && i < r) {
 				if (buf[i] != '\r' && buf[i] != '\n') {
 					if (!ignore_whitespace
-					    || !isspace(buf[i]))
+					    || !isspace((unsigned char)buf[i]))
 						hash = diff_atom_hash_update(
 						    hash, buf[i]);
 					if (buf[i] == '\0')
@@ -142,7 +142,7 @@ diff_data_atomize_text_lines_mmap(struct diff_data *d)
 
 		while (line_end < end && *line_end != '\r' && *line_end != '\n') {
 			if (!ignore_whitespace
-			    || !isspace(*line_end))
+			    || !isspace((unsigned char)*line_end))
 				hash = diff_atom_hash_update(hash, *line_end);
 			if (*line_end == '\0')
 				embedded_nul = true;
blob - b227f7fcc8dee90ca0acf92cdc217e47c29a37eb
blob + 3196ebae01117f7b1caa9b36f55c780ee0c460e5
--- lib/diff_main.c
+++ lib/diff_main.c
@@ -64,11 +64,11 @@ buf_cmp(const unsigned char *left, size_t left_len,
 			unsigned char cl = left[il];
 			unsigned char cr = right[ir];
 
-			if (isspace(cl) && il < left_len) {
+			if (isspace((unsigned char)cl) && il < left_len) {
 				il++;
 				continue;
 			}
-			if (isspace(cr) && ir < right_len) {
+			if (isspace((unsigned char)cr) && ir < right_len) {
 				ir++;
 				continue;
 			}
@@ -82,12 +82,12 @@ buf_cmp(const unsigned char *left, size_t left_len,
 		}
 		while (il < left_len) {
 			unsigned char cl = left[il++];
-			if (!isspace(cl))
+			if (!isspace((unsigned char)cl))
 				return 1;
 		}
 		while (ir < right_len) {
 			unsigned char cr = right[ir++];
-			if (!isspace(cr))
+			if (!isspace((unsigned char)cr))
 				return -1;
 		}
 
blob - bc44a51ea36b8a3a7cd5581e6787fcdda23168c6
blob + 8b2477047aa2fbba35eb20ce030a857b1d0c4664
--- lib/diff_output.c
+++ lib/diff_output.c
@@ -262,7 +262,7 @@ diff_output_trailing_newline_msg(struct diff_output_in
 static bool
 is_function_prototype(unsigned char ch)
 {
-	return (isalpha(ch) || ch == '_' || ch == '$');
+	return (isalpha((unsigned char)ch) || ch == '_' || ch == '$');
 }
 
 #define begins_with(s, pre) (strncmp(s, pre, sizeof(pre)-1) == 0)