aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/variable.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-02-12 05:44:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-02-12 05:44:51 +0200
commit7bbe8042dbbea81c713576e1ce69d00bbba5d4b6 (patch)
tree2e0fe544517e6251b18c0c5ba6f57dd74c3a19aa /libbuild2/variable.cxx
parent0249399f06ab77c58e02698a6a0b2352f0dbf1ae (diff)
Move to_string(uint64_t,base,width) to utility, use everywhere
Diffstat (limited to 'libbuild2/variable.cxx')
-rw-r--r--libbuild2/variable.cxx11
1 files changed, 1 insertions, 10 deletions
diff --git a/libbuild2/variable.cxx b/libbuild2/variable.cxx
index 3db0fd0..795af6c 100644
--- a/libbuild2/variable.cxx
+++ b/libbuild2/variable.cxx
@@ -3,7 +3,6 @@
#include <libbuild2/variable.hxx>
-#include <cstdio> // snprintf()
#include <cstring> // memcmp(), memcpy()
#include <libbutl/path-pattern.hxx>
@@ -1830,15 +1829,7 @@ namespace build2
}
case json_type::hexadecimal_number:
{
- // Hexadecimal representation of 64-bit integers requires a maximum of
- // 10 character (plus '\0'): 0xffffffff.
- //
- char buf[11];
- snprintf (buf, sizeof (buf),
- "0x%llx",
- static_cast<unsigned long long> (v.unsigned_number));
-
- ns.push_back (name (string (buf)));
+ ns.push_back (name (to_string (v.unsigned_number, 16)));
break;
}
case json_type::string: