Fix max length inconsistencies + typo

This commit is contained in:
Arkshine
2015-10-05 19:06:38 +02:00
parent 138b9e1510
commit c29eabec50
18 changed files with 54 additions and 58 deletions

View File

@ -109,7 +109,7 @@ static void read_mirror(char *input)
*data='\0';
// mark down the source
ke::SafeSprintf(source, sizeof(source)-1, "%s", input);
ke::SafeSprintf(source, sizeof(source), "%s", input);
*data=old;
@ -129,13 +129,13 @@ static void read_mirror(char *input)
old=*data;
*data='\0';
ke::SafeSprintf(dest, sizeof(dest)-1, "%s", data2);
ke::SafeSprintf(dest, sizeof(dest), "%s", data2);
*data=old;
if (strcmp(dest, CurrentModName)==0)
{
ke::SafeSprintf(CurrentModName, sizeof(CurrentModName)-1, "%s", source);
ke::SafeSprintf(CurrentModName, sizeof(CurrentModName), "%s", source);
}
}
@ -314,7 +314,7 @@ int ReadConfig(void)
FILE *fp=fopen(FileName,"r");
ke::SafeSprintf(CurrentModName, sizeof(CurrentModName)-1, "%s", MF_GetModname());
ke::SafeSprintf(CurrentModName, sizeof(CurrentModName), "%s", MF_GetModname());
if (!fp)
{

View File

@ -22,12 +22,12 @@
#define CHECK_FUNCTION(x) \
if (x < 0 || x >= HAM_LAST_ENTRY_DONT_USE_ME_LOL) { \
char msg[1024]; \
ke::SafeSprintf(msg, sizeof(msg)-1, "Function out of bounds. Got: %d Max: %d", x, HAM_LAST_ENTRY_DONT_USE_ME_LOL - 1); \
ke::SafeSprintf(msg, sizeof(msg), "Function out of bounds. Got: %d Max: %d", x, HAM_LAST_ENTRY_DONT_USE_ME_LOL - 1); \
FailPlugin(amx, x, HAM_INVALID_FUNC, msg); \
return 0; \
} else if (hooklist[x].isset == 0) { \
char msg[1024]; \
ke::SafeSprintf(msg, sizeof(msg)-1, "Function %s is not configured in hamdata.ini.", hooklist[x].name); \
ke::SafeSprintf(msg, sizeof(msg), "Function %s is not configured in hamdata.ini.", hooklist[x].name); \
FailPlugin(amx, x, HAM_FUNC_NOT_CONFIGURED, msg); \
return 0; \
}

View File

@ -707,7 +707,7 @@ static cell AMX_NATIVE_CALL RegisterHamFromEntity(AMX *amx, cell *params)
// It may very well be wrong (such as lots of TS weapons have the same classname)
// but it's the best we can do, and better than nothing.
// (only used for display)
ke::SafeSprintf(classname, sizeof(classname) - 1, "%s", STRING(Entity->v.classname));
ke::SafeSprintf(classname, sizeof(classname), "%s", STRING(Entity->v.classname));
// If we got here, the function is not hooked
Hook *hook = new Hook(vtable, hooklist[func].vtid, hooklist[func].targetfunc, hooklist[func].isvoid, hooklist[func].needsretbuf, hooklist[func].paramcount, classname);