From 7bbe8042dbbea81c713576e1ce69d00bbba5d4b6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 12 Feb 2024 05:44:51 +0200 Subject: Move to_string(uint64_t,base,width) to utility, use everywhere --- libbuild2/variable.cxx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'libbuild2/variable.cxx') 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 -#include // snprintf() #include // memcmp(), memcpy() #include @@ -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 (v.unsigned_number)); - - ns.push_back (name (string (buf))); + ns.push_back (name (to_string (v.unsigned_number, 16))); break; } case json_type::string: -- cgit v1.1