[Scummvm-git-logs] scummvm master -> 1c622cee05049f59dc0613ef28e8f775722aac1e
bluegr
noreply at scummvm.org
Sat Nov 16 18:19:56 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1c622cee05 GLK: AGT: Fix unintended comparison for digits in debugout()
Commit: 1c622cee05049f59dc0613ef28e8f775722aac1e
https://github.com/scummvm/scummvm/commit/1c622cee05049f59dc0613ef28e8f775722aac1e
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2024-11-16T20:19:53+02:00
Commit Message:
GLK: AGT: Fix unintended comparison for digits in debugout()
Typo detected in -funsigned-char builds:
comparison is always true due to limited range of data type [-Wtype-limits]
} else if (*s >= 0 && *s <= 9) linebuff[lp++] = ' ';
^
but it's a happy accident; it's not a signedness issue, rather the code was
looking for the first non-printable control characters in the ASCII table,
instead of the numeric digits '0' to '9'.
Changed paths:
engines/glk/agt/interface.cpp
diff --git a/engines/glk/agt/interface.cpp b/engines/glk/agt/interface.cpp
index 2e45779f202..da190463d0e 100644
--- a/engines/glk/agt/interface.cpp
+++ b/engines/glk/agt/interface.cpp
@@ -173,7 +173,7 @@ void debugout(const char *s) {
lp = 0;
} else if (*s == '\t') {
for (i = 0; i < 3; i++) linebuff[lp++] = ' ';
- } else if (*s >= 0 && *s <= 9) linebuff[lp++] = ' ';
+ } else if (*s >= '0' && *s <= '9') linebuff[lp++] = ' ';
else linebuff[lp++] = *s;
}
linebuff[lp] = 0;
More information about the Scummvm-git-logs
mailing list