mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
Fixed field lookup bug.
Fixed bug in CString.
This commit is contained in:
parent
75c5bebc41
commit
b67da6965f
@ -32,7 +32,8 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Grow(strlen(d));
|
Grow(strlen(d));
|
||||||
strcpy(v, d);
|
if (v)
|
||||||
|
strcpy(v, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear()
|
void clear()
|
||||||
@ -70,6 +71,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
void Grow(int d)
|
void Grow(int d)
|
||||||
{
|
{
|
||||||
|
if (d<1)
|
||||||
|
return;
|
||||||
if (d > mSize)
|
if (d > mSize)
|
||||||
{
|
{
|
||||||
char *t = new char[d+1];
|
char *t = new char[d+1];
|
||||||
|
@ -215,7 +215,7 @@ static cell AMX_NATIVE_CALL sql_getfield(AMX *amx, cell *params) // 2-4 params
|
|||||||
SQLResult *Result = Results[id];
|
SQLResult *Result = Results[id];
|
||||||
int numParams = (*params)/sizeof(cell);
|
int numParams = (*params)/sizeof(cell);
|
||||||
cell *fAddr = NULL;
|
cell *fAddr = NULL;
|
||||||
const char *field = Result->GetField(id);
|
const char *field = Result->GetField(params[2]-1);
|
||||||
if (field == NULL)
|
if (field == NULL)
|
||||||
{
|
{
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
@ -262,7 +262,7 @@ static cell AMX_NATIVE_CALL sql_getresult(AMX *amx, cell *params) // 4 params
|
|||||||
cell *fAddr = NULL;
|
cell *fAddr = NULL;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
const char *column = MF_GetAmxString(amx, params[2], 0, &len);
|
const char *column = MF_GetAmxString(amx, params[2], 0, &len);
|
||||||
const char *field = Result->GetField(id);
|
const char *field = Result->GetField(column);
|
||||||
if (field == NULL)
|
if (field == NULL)
|
||||||
{
|
{
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
|
Loading…
Reference in New Issue
Block a user