summaryrefslogtreecommitdiff
path: root/include/inspircd.h
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2013-06-05 17:52:39 -0700
committerAttila Molnar <attilamolnar@hush.com>2013-06-05 17:52:39 -0700
commitf00ac52c5d593fcb761fc316b2582bb06158035c (patch)
treebec88a8a69c4a912606636c9df6283c154962fef /include/inspircd.h
parentd9d99cd02dadf34bfcc220734ba0c422f0acb3e6 (diff)
parent5d0b2b7cfccf057e7abab94c41065f94420899cd (diff)
Merge pull request #544 from SaberUK/master+kill-maxbuf
Purge MAXBUF in favour of a configuration option.
Diffstat (limited to 'include/inspircd.h')
-rw-r--r--include/inspircd.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 957032da2..f86945903 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -82,20 +82,19 @@ CoreExport extern InspIRCd* ServerInstance;
*/
template<typename T> inline std::string ConvNumeric(const T &in)
{
- if (in == 0) return "0";
- char res[MAXBUF];
- char* out = res;
+ if (in == 0)
+ return "0";
T quotient = in;
- while (quotient) {
- *out = "0123456789"[ std::abs( (long)quotient % 10 ) ];
- ++out;
+ std::string out;
+ while (quotient)
+ {
+ out += "0123456789"[ std::abs( (long)quotient % 10 ) ];
quotient /= 10;
}
if (in < 0)
- *out++ = '-';
- *out = 0;
- std::reverse(res,out);
- return res;
+ out += '-';
+ std::reverse(out.begin(), out.end());
+ return out;
}
/** Template function to convert any input type to std::string