summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-04-29 23:53:23 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-04-29 23:53:23 +0900
commit549dd5b2a70d19fb4bc863f623ae5b208e3f27fc (patch)
treeb9fd948372a7d36417e16961ca086323fa2e7ed5 /src/util.h
parent6b7a51d5e043c5c916b394cf8f7580023f616b95 (diff)
uitos: Fix off-by-one error bug
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h
index c31019f2..4803b7a9 100644
--- a/src/util.h
+++ b/src/util.h
@@ -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] = ',';
}
}