moar const
This commit is contained in:
parent
bf908bbfbf
commit
3625bd407e
@ -1917,7 +1917,8 @@ int luatpt_setfpscap(lua_State* l)
|
|||||||
}
|
}
|
||||||
int luatpt_getscript(lua_State* l)
|
int luatpt_getscript(lua_State* l)
|
||||||
{
|
{
|
||||||
char *filedata = NULL, *fileuri = NULL, *filename = NULL, *lastError = NULL, *luacommand = NULL;
|
char *filedata = NULL, *fileuri = NULL, *filename = NULL, *luacommand = NULL;
|
||||||
|
const char *lastError = NULL;
|
||||||
std::string fileauthor = "", fileid = "";
|
std::string fileauthor = "", fileid = "";
|
||||||
int len, ret,run_script;
|
int len, ret,run_script;
|
||||||
FILE * outputfile;
|
FILE * outputfile;
|
||||||
@ -1927,7 +1928,7 @@ int luatpt_getscript(lua_State* l)
|
|||||||
run_script = luaL_optint(l, 3, 0);
|
run_script = luaL_optint(l, 3, 0);
|
||||||
if(!fileauthor.length() || !fileid.length())
|
if(!fileauthor.length() || !fileid.length())
|
||||||
{
|
{
|
||||||
lastError = mystrdup("Script Author or ID not given");
|
lastError = "Script Author or ID not given";
|
||||||
goto fin;
|
goto fin;
|
||||||
}
|
}
|
||||||
if(!ConfirmPrompt::Blocking("Do you want to install script?", fileid, "Install"))
|
if(!ConfirmPrompt::Blocking("Do you want to install script?", fileid, "Install"))
|
||||||
@ -1941,12 +1942,12 @@ int luatpt_getscript(lua_State* l)
|
|||||||
|
|
||||||
if(len <= 0 || !filedata)
|
if(len <= 0 || !filedata)
|
||||||
{
|
{
|
||||||
strcpy(lastError, "Server did not return data.");
|
lastError = "Server did not return data.";
|
||||||
goto fin;
|
goto fin;
|
||||||
}
|
}
|
||||||
if(ret != 200)
|
if(ret != 200)
|
||||||
{
|
{
|
||||||
lastError = mystrdup(http_ret_text(ret));
|
lastError = http_ret_text(ret);
|
||||||
goto fin;
|
goto fin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1976,7 +1977,7 @@ int luatpt_getscript(lua_State* l)
|
|||||||
|
|
||||||
if(!outputfile)
|
if(!outputfile)
|
||||||
{
|
{
|
||||||
lastError = mystrdup("Unable to write to file");
|
lastError = "Unable to write to file";
|
||||||
goto fin;
|
goto fin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2001,7 +2002,6 @@ fin:
|
|||||||
if(lastError)
|
if(lastError)
|
||||||
{
|
{
|
||||||
return luaL_error(l, lastError);
|
return luaL_error(l, lastError);
|
||||||
free(lastError);
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user