Hi!
According to http://www.arm.linux.org.uk/docs/faqs/signedchar.php,
"char" is unsigned on ARM, but signed on e.g. i386.
Hence, the loop
char c;
while (c >= 0) {
/* foo */
c--;
}
wraps around (0-1 == 255) and produces undesired results. The assertion
then aborts the program, triggering the segfault.
The attached patch explicitly asks for a signed char, thus fixing the
problem.
HTH
From: Adrian Knoth <[email protected]>
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=690206
Forwarded: no, but needed
Description: Fix segmentation fault on ARM.
--- a/Src/menustats.c
+++ b/Src/menustats.c
@@ -307,7 +307,7 @@ static int download_list() {
/* Displays the choice of stats sources */
#define MAXPING (26 * 2)
void update_stats() {
- char c;
+ signed char c;
BUFFER *inifile;
BUFFER *pingernames;
BUFFER *goodpingers;