aboutsummaryrefslogtreecommitdiff
path: root/src/genericobject.cpp
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2014-12-11 17:58:50 -0500
committerShadowNinja <shadowninja@minetest.net>2015-01-03 14:50:16 -0500
commit3c3887bb198c07b50ad3451f228aadfe6fd25168 (patch)
treefec7a00f1e64b9d2fc269d41cef42940c155c62a /src/genericobject.cpp
parentd91559b8f08a8e1957f673307b777da176c31b5a (diff)
downloadminetest-3c3887bb198c07b50ad3451f228aadfe6fd25168.tar.gz
minetest-3c3887bb198c07b50ad3451f228aadfe6fd25168.tar.bz2
minetest-3c3887bb198c07b50ad3451f228aadfe6fd25168.zip
Deduplicate code and use stdlib in string functions
Diffstat (limited to 'src/genericobject.cpp')
0 files changed, 0 insertions, 0 deletions
class="hl kwb">unsigned int data_size) { std::string ret; ret.reserve(data_size * 2); char buf2[3]; buf2[2] = '\0'; for (unsigned int i = 0; i < data_size; i++) { unsigned char c = (unsigned char)data[i]; buf2[0] = hex_chars[(c & 0xf0) >> 4]; buf2[1] = hex_chars[c & 0x0f]; ret.append(buf2); } return ret; } static inline std::string hex_encode(const std::string &data) {