I'm working on a filter, tried GDB but with no luck.
This is my code.Code:%{ #include <stdio.h> #include <stdlib.h> #include <string.h> FILE *trabtotal; int tipo; int i; %} %% ^\\(R|r)(E|e)(L|l)(A|a)(T|t)(O|o)(R|r)(I|i)(O|o) {if(tipo==1) {fprintf(trabtotal,"\\documentclass{report}\n\n");} if (tipo==2) {fprintf(trabtotal,"Esta expressão não existe em HTML");}} %% int yywrap() { return 1; } int main(int argc,char *argv[]) { printf("ola"); for( i=argc; i>0; i--) { printf("%s\n", argv[i]) ;} if ((strcmp(argv[1],"-l")==0)) {tipo=1;} else{ if ((strcmp(argv[1],"-h")==0)) {tipo=2;} } yylex(); printf("Ficheiro convertido com Sucesso.\n\n"); return 0; }
Anyone sees anything that may cause this segmentation fault ?
It doesn't even printf("ola");
![]()