Fix linux build.

This commit is contained in:
Ryan Stecker 2014-09-13 03:13:33 -05:00
parent 3ffd4cd835
commit 981ffdfc82

View File

@ -284,13 +284,14 @@ static cell_t sm_GetEventString(IPluginContext *pContext, const cell_t *params)
char *key; char *key;
pContext->LocalToString(params[2], &key); pContext->LocalToString(params[2], &key);
char *defValue = ""; char *defValue = NULL;
if (params[0] > 4) if (params[0] > 4)
{ {
pContext->LocalToString(params[5], &defValue); pContext->LocalToString(params[5], &defValue);
} }
pContext->StringToLocalUTF8(params[3], params[4], pInfo->pEvent->GetString(key, defValue), NULL); const char *value = pInfo->pEvent->GetString(key, defValue ? defValue : "");
pContext->StringToLocalUTF8(params[3], params[4], value, NULL);
return 1; return 1;
} }