Replace a few more sprintf with snprintf

This commit is contained in:
Henrik Rydgård
2024-10-15 15:45:19 +02:00
parent 1280fcc581
commit 41eeb491e7
4 changed files with 14 additions and 16 deletions
+3 -5
View File
@@ -275,10 +275,8 @@ public:
const char *GetName() override { return nm.name; }
const char *GetTypeName() override { return GetStaticTypeName(); }
static const char *GetStaticTypeName() { return "Module"; }
void GetQuickInfo(char *ptr, int size) override
{
// ignore size
sprintf(ptr, "%sname=%s gp=%08x entry=%08x",
void GetQuickInfo(char *ptr, int size) override {
snprintf(ptr, size, "%sname=%s gp=%08x entry=%08x",
isFake ? "faked " : "",
nm.name,
nm.gp_value,
@@ -394,7 +392,7 @@ public:
// Add the symbol to the symbol map for debugging.
char temp[256];
sprintf(temp,"zz_%s", GetFuncName(func.moduleName, func.nid));
snprintf(temp, sizeof(temp), "zz_%s", GetFuncName(func.moduleName, func.nid));
g_symbolMap->AddFunction(temp,func.stubAddr,8);
// Keep track and actually hook it up if possible.