aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/StringUtil.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/StringUtil.cc')
-rw-r--r--src/FbTk/StringUtil.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/FbTk/StringUtil.cc b/src/FbTk/StringUtil.cc
index 0dcd989..fa809be 100644
--- a/src/FbTk/StringUtil.cc
+++ b/src/FbTk/StringUtil.cc
@@ -145,10 +145,17 @@ int extractNumber(const std::string& in, unsigned long long& out) {
145 145
146std::string number2String(long long num) { 146std::string number2String(long long num) {
147 char s[128]; 147 char s[128];
148 sprintf(s, "%lld", num); 148 snprintf(s, sizeof(s), "%lld", num);
149 return std::string(s); 149 return std::string(s);
150} 150}
151 151
152std::string number2HexString(long long num) {
153 char s[17];
154 snprintf(s, sizeof(s), "%lx", num);
155 return std::string(s);
156}
157
158
152/** 159/**
153 Tries to find a string in another and 160 Tries to find a string in another and
154 ignoring the case of the characters 161 ignoring the case of the characters