Changeset - r11793:53a67e77b8b3
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-04-30 12:11:51
rubidium@openttd.org
(svn r16188) -Fix [FS#2874] (r16124): printing the first 4 bytes worth of a 8 byte integer causes some unwanted side effects when the system is not little-endian.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/strings.cpp
Show inline comments
 
@@ -194,25 +194,25 @@ static char *FormatNumber(char *buff, in
 
	}
 

	
 
	num = number;
 

	
 
	tot = 0;
 
	for (i = 0; i < 20; i++) {
 
		quot = 0;
 
		if (num >= divisor) {
 
			quot = num / divisor;
 
			num = num % divisor;
 
		}
 
		if (tot |= quot || i == 19) {
 
			buff += seprintf(buff, last, "%i", quot);
 
			buff += seprintf(buff, last, "%i", (int)quot);
 
			if ((i % 3) == 1 && i != 19) buff = strecpy(buff, separator, last);
 
		}
 

	
 
		divisor /= 10;
 
	}
 

	
 
	*buff = '\0';
 

	
 
	return buff;
 
}
 

	
 
static char *FormatCommaNumber(char *buff, int64 number, const char *last)
0 comments (0 inline, 0 general)