Subversion Repositories wimsdev

Rev

Rev 8304 | Rev 8312 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8304 Rev 8305
Line 3586... Line 3586...
3586
/******************************************************************************/
3586
/******************************************************************************/
3587
 
3587
 
3588
char *get_color(FILE *infile , int last){
3588
char *get_color(FILE *infile , int last){
3589
    int c,i = 0,is_hex = 0;
3589
    int c,i = 0,is_hex = 0;
3590
    char temp[MAX_COLOR_STRING], *string;
3590
    char temp[MAX_COLOR_STRING], *string;
3591
    char not_allowed[10] = "0123456789";
3591
    const char *not_allowed = "0123456789";
3592
    while(( (c=getc(infile)) != EOF ) && ( c != '\n') && ( c != ',' ) && ( c != ';' ) ){
3592
    while(( (c=getc(infile)) != EOF ) && ( c != '\n') && ( c != ',' ) && ( c != ';' ) ){
3593
        if( i > MAX_COLOR_STRING ){ canvas_error("colour string is too big ... ? ");}
3593
        if( i > MAX_COLOR_STRING ){ canvas_error("colour string is too big ... ? ");}
3594
        if( c == '#' ){
3594
        if( c == '#' ){
3595
            is_hex = 1;
3595
            is_hex = 1;
3596
        }
3596
        }
Line 3676... Line 3676...
3676
double get_real(FILE *infile, int last){ /* accept anything that looks like an number ?  last = 0 : more arguments ; last=1 final argument */
3676
double get_real(FILE *infile, int last){ /* accept anything that looks like an number ?  last = 0 : more arguments ; last=1 final argument */
3677
    int c,i=0,found_calc = 0;
3677
    int c,i=0,found_calc = 0;
3678
    double y;
3678
    double y;
3679
    char tmp[MAX_INT];
3679
    char tmp[MAX_INT];
3680
    /* these things are 'allowed functions' : *,^,+,-,/,(,),e,arc,cos,tan,pi,log,ln */
3680
    /* these things are 'allowed functions' : *,^,+,-,/,(,),e,arc,cos,tan,pi,log,ln */
3681
    char allowed[21] = "earcostanpilog+-/^()";/* assuming these are allowed stuff in a 'number'*/
3681
    const char *allowed = "earcostanpilog+-/^()";/* assuming these are allowed stuff in a 'number'*/
3682
    char not_allowed[17] = "#bdfghjkmquvwxyz";/* avoid segmentation faults in a "atof()" and "wims eval" */
3682
    const char *not_allowed = "#bdfghjkmquvwxyz";/* avoid segmentation faults in a "atof()" and "wims eval" */
3683
    while(( (c=getc(infile)) != EOF ) && ( c != ',') && (c != '\n') && ( c != ';')){
3683
    while(( (c=getc(infile)) != EOF ) && ( c != ',') && (c != '\n') && ( c != ';')){
3684
     if( c != ' ' ){
3684
     if( c != ' ' ){
3685
      if( i == 0 &&  c == '+' ){
3685
      if( i == 0 &&  c == '+' ){
3686
       continue;
3686
       continue;
3687
      }
3687
      }