Rev 8347 | Rev 8349 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8347 | Rev 8348 | ||
---|---|---|---|
Line 3713... | Line 3713... | ||
3713 | 3713 | ||
3714 | double get_real(FILE *infile, int last){ /* accept anything that looks like an number ? last = 0 : more arguments ; last=1 final argument */ |
3714 | double get_real(FILE *infile, int last){ /* accept anything that looks like an number ? last = 0 : more arguments ; last=1 final argument */ |
3715 | int c,i=0,found_calc = 0; |
3715 | int c,i=0,found_calc = 0; |
3716 | double y; |
3716 | double y; |
3717 | char tmp[MAX_INT]; |
3717 | char tmp[MAX_INT]; |
- | 3718 | /* |
|
3718 |
|
3719 | these things are 'allowed functions' : *,^,+,-,/,(,),e,arc,cos,tan,pi,log,ln,sqrt,abs |
- | 3720 | but thereshould be a better way to avoid segfaults ! |
|
- | 3721 | */ |
|
3719 | const char *allowed = " |
3722 | const char *allowed = "earcostanpilogqb*+-/^()";/* assuming these are allowed stuff in a 'number'*/ |
3720 | const char *not_allowed = " |
3723 | const char *not_allowed = "#dfhjkmuvwxyz{}[]%&~!$";/* avoid segmentation faults in a "atof()" and "wims eval" */ |
3721 | while(( (c=getc(infile)) != EOF ) && ( c != ',') && (c != '\n') && ( c != ';')){ |
3724 | while(( (c=getc(infile)) != EOF ) && ( c != ',') && (c != '\n') && ( c != ';')){ |
3722 | if( c != ' ' ){ |
3725 | if( c != ' ' ){ |
3723 | if( i == 0 && c == '+' ){ |
3726 | if( i == 0 && c == '+' ){ |
3724 | continue; |
3727 | continue; |
3725 | } |
3728 | } |