c_lua_converge_optional_args: fixed pointers
This commit is contained in:
parent
5fc5697825
commit
fcec176008
@ -1,3 +1,3 @@
|
||||
width = "Width"
|
||||
heigt = "Height"
|
||||
extra = "extra"
|
||||
width = "Width line"
|
||||
heigt = "Height line"
|
||||
extra = "extra line"
|
||||
|
@ -26,7 +26,7 @@ int main ()
|
||||
|
||||
void load(char *filename, int number_of_args, ...){
|
||||
int i =1;
|
||||
char test[100];
|
||||
char *test[number_of_args];
|
||||
|
||||
va_list opt_args;
|
||||
|
||||
@ -40,14 +40,15 @@ void load(char *filename, int number_of_args, ...){
|
||||
|
||||
for(i = 0; i < number_of_args; i++)
|
||||
{
|
||||
strcpy(test, va_arg(opt_args, char*));
|
||||
lua_getglobal(L, test);
|
||||
test[i] = va_arg(opt_args, char*);
|
||||
lua_getglobal(L, test[i]);
|
||||
if (!lua_isstring(L, (i+1))){
|
||||
error(L, "%s Missing variable: %s%s\n",KRED, test, KNRM);
|
||||
error(L, "%s Missing variable: %s%s\n",KRED, test[i], KNRM);
|
||||
strcpy(test[i], " ");
|
||||
continue;
|
||||
}
|
||||
strcpy(test, lua_tostring(L, (i+1) ));
|
||||
printf("Is Test: %s\n", test);
|
||||
strcpy(test[i], lua_tostring(L, (i+1) ));
|
||||
//printf("Is Test: %s\n", test[i]);
|
||||
|
||||
}
|
||||
va_end(opt_args);
|
||||
|
Loading…
x
Reference in New Issue
Block a user