Replace ke::SafeSprintf with ke::SafeStrcpy (#784)

This commit is contained in:
Michael Flaherty
2018-03-19 20:12:51 +00:00
committed by Asher Baker
parent 0a91b1f5b1
commit 956f264b85
16 changed files with 45 additions and 52 deletions
+3 -9
View File
@@ -1171,18 +1171,12 @@ reswitch:
int userid;
if (!bridge->DescribePlayer(*value, &name, &auth, &userid))
return pCtx->ThrowNativeError("Client index %d is invalid (arg %d)", *value, arg);
ke::SafeSprintf(buffer,
sizeof(buffer),
"%s<%d><%s><>",
name,
userid,
auth);
ke::SafeSprintf(buffer, sizeof(buffer), "%s<%d><%s><>", name, userid, auth);
}
else
{
ke::SafeSprintf(buffer,
sizeof(buffer),
"Console<0><Console><Console>");
ke::SafeStrcpy(buffer, sizeof(buffer), "Console<0><Console><Console>");
}
if (!AddString(&buf_p, llen, buffer, width, prec, flags))
return pCtx->ThrowNativeError("Escaped string would be truncated (arg %d)", arg);