mirror of
https://github.com/aria2/aria2.git
synced 2025-01-08 19:11:47 +00:00
uitos: Fix off-by-one error bug
This commit is contained in:
parent
6b7a51d5e0
commit
549dd5b2a7
@ -193,7 +193,7 @@ std::string uitos(T n, bool comma = false)
|
||||
--i;
|
||||
for(int j = 0; n; --i, ++j, n /= 10) {
|
||||
res[i] = (n%10) + '0';
|
||||
if(comma && (j+1)%3 == 0) {
|
||||
if(comma && i > 1 && (j+1)%3 == 0) {
|
||||
res[--i] = ',';
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user