Skip to content

Commit

Permalink
Update vProc.c
Browse files Browse the repository at this point in the history
Final fpos type correction
  • Loading branch information
MaximeAlgosup committed Feb 23, 2024
1 parent bcd1fa6 commit 5f7bb2d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/vProc.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ bool run(instruction_t inst, carry_t *carry, FILE *file, char *filename, asm_err
return true;
case 1: //goto
pos = searchLabel(inst.arg, filename, errData);
if(pos == -1){
return false;
}
// goto label
fsetpos(file, &pos);
return true;
Expand All @@ -121,9 +118,6 @@ bool run(instruction_t inst, carry_t *carry, FILE *file, char *filename, asm_err
}
// search label
pos = searchLabel(inst.arg, filename, errData);
if(pos == -1){
return false;
}
// goto label
fsetpos(file, &pos);
return true;
Expand Down Expand Up @@ -352,7 +346,7 @@ fpos_t searchLabel(int labId, char *filename, asm_error_t *errData){
FILE *file = fopen(filename, "rb");
if(file == NULL){
errorfnf(filename, errData);
return 0;
exit(EXIT_FAILURE);
}
char line[LINE_MAX_BITS];
fpos_t pos;
Expand All @@ -373,7 +367,7 @@ fpos_t searchLabel(int labId, char *filename, asm_error_t *errData){
}
}
fclose(file);
return (fpos_t)-1;
exit(EXIT_FAILURE);
}


Expand Down

0 comments on commit 5f7bb2d

Please sign in to comment.