lib: fix 6502 syscall generator
authorBrett Gordon <beretta42@gmail.com>
Thu, 5 Apr 2018 16:15:58 +0000 (12:15 -0400)
committerBrett Gordon <beretta42@gmail.com>
Thu, 5 Apr 2018 16:15:58 +0000 (12:15 -0400)
was trying to use an unitialized index to array of syscall names.

Library/tools/syscall_6502.c

index 790981d..b089b8d 100644 (file)
@@ -55,7 +55,7 @@ static void write_makefile(void)
   fprintf(fp, "AS = ca65\n");
   fprintf(fp, "AR = ar65\n");
   fprintf(fp, "ASYS = syscall.s\n");
-  fprintf(fp, "ASRCS = syscall_%s.s\n", syscall_name[i]);
+  fprintf(fp, "ASRCS = syscall_%s.s\n", syscall_name[0]);
   for (i = 1; i < NR_SYSCALL; i++)
     fprintf(fp, "ASRCS += syscall_%s.s\n", syscall_name[i]);
   fprintf(fp, "\n\nASRCALL = $(ASRCS) $(ASYS)\n");