Switch StringToInt(Ex) from strtol to strtoul (bug 5939, r=psychonic).

This commit is contained in:
Kyle Sanderson 2013-10-06 15:40:03 -04:00
parent 3174fb7d19
commit e3cb33bbda

View File

@ -122,7 +122,7 @@ static cell_t sm_strconvint(IPluginContext *pCtx, const cell_t *params)
char *str, *dummy;
pCtx->LocalToString(params[1], &str);
return static_cast<cell_t>(strtol(str, &dummy, params[2]));
return static_cast<cell_t>(strtoul(str, &dummy, params[2]));
}
static cell_t StringToIntEx(IPluginContext *pCtx, const cell_t *params)
@ -132,7 +132,7 @@ static cell_t StringToIntEx(IPluginContext *pCtx, const cell_t *params)
pCtx->LocalToString(params[1], &str);
pCtx->LocalToPhysAddr(params[2], &addr);
*addr = static_cast<cell_t>(strtol(str, &dummy, params[3]));
*addr = static_cast<cell_t>(strtoul(str, &dummy, params[3]));
return dummy - str;
}