diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-04-29 23:53:23 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-04-29 23:53:23 +0900 |
| commit | 549dd5b2a70d19fb4bc863f623ae5b208e3f27fc (patch) | |
| tree | b9fd948372a7d36417e16961ca086323fa2e7ed5 /src/util.h | |
| parent | 6b7a51d5e043c5c916b394cf8f7580023f616b95 (diff) | |
uitos: Fix off-by-one error bug
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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] = ','; } } |
