Skip to content
Browse files

Correct a few bugs in the searching to load bytecode

  • Loading branch information...
1 parent 8f0e31f commit e6ff0a0e0d14d4ecfd5d6ee813edf90e9e734e8d @atrodo committed Feb 8, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 loader.c
View
5 loader.c
@@ -60,16 +60,17 @@ lorito_load_bytecode(Lorito_Interp *interp, Lorito_Str* filename)
if (result == NULL)
{
char *with_ext = (char *) malloc(strlen(filename->original) + 4);
- strcat(with_ext, filename->original);
+ strcpy(with_ext, filename->original);
strcat(with_ext, ".ito");
- result = loadbc(interp, filename->original);
+ result = loadbc(interp, with_ext);
free(with_ext);
}
if (result == NULL)
{
printf("(%s)\n", filename);
perror("Failed to open file");
+ result = (Lorito_File *) null;
}
return result;

0 comments on commit e6ff0a0

Please sign in to comment.
Something went wrong with that request. Please try again.