summaryrefslogtreecommitdiffhomepage
path: root/src/internal
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-04-27 17:33:06 +0000
committermidipix <writeonce@midipix.org>2024-04-27 20:21:09 +0000
commit6a74673f967c1b146000c8a47cfc094293f6db72 (patch)
tree6245d4e5173a98ffc8fb69fc035c5ba284bb9f20 /src/internal
parent473806712f583ef53e8179bd4d252f3c4b66f34a (diff)
downloadmdso-6a74673f967c1b146000c8a47cfc094293f6db72.tar.bz2
mdso-6a74673f967c1b146000c8a47cfc094293f6db72.tar.xz
mdso_objgen_symentry(): eliminate the use of sprintf().
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/mdso_object_impl.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/internal/mdso_object_impl.h b/src/internal/mdso_object_impl.h
index bae8d08..539a77d 100644
--- a/src/internal/mdso_object_impl.h
+++ b/src/internal/mdso_object_impl.h
@@ -31,3 +31,17 @@ static inline void mdso_obj_write_quad(unsigned char * ch, uint64_t val)
ch[6] = val >> 48;
ch[7] = val >> 56;
}
+
+static inline void mdso_obj_write_dec(unsigned char * ch, uint64_t dec)
+{
+ int digits;
+ uint64_t val;
+
+ *ch = '0';
+
+ for (digits=0,val=dec; val; digits++)
+ val /= 10;
+
+ for (val=dec; val; val/=10)
+ ch[--digits] = (val % 10) + '0';
+}