ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/calexpr.c
(Generate patch)

Comparing ray/src/common/calexpr.c (file contents):
Revision 2.16 by greg, Thu Feb 16 09:49:29 1995 UTC vs.
Revision 2.17 by gwlarson, Mon Aug 17 17:57:30 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
1 > /* Copyright (c) 1998 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4 < static char SCCSid[] = "$SunId$ LBL";
4 > static char SCCSid[] = "$SunId$ SGI";
5   #endif
6  
7   /*
# Line 539 | Line 539 | getnum()                       /* scan a positive float */
539      if (lnext == '.' && i < MAXWORD) {
540          str[i++] = lnext;
541          lnext = scan();
542 +        if (i == 1 && !isdigit(lnext))
543 +            syntax("badly formed number");
544          while (isdigit(lnext) && i < MAXWORD) {
545              str[i++] = lnext;
546              lnext = scan();
547          }
548      }
549 <    if ((lnext == 'e' || lnext == 'E') && i < MAXWORD) {
549 >    if ((lnext == 'e' | lnext == 'E') && i < MAXWORD) {
550          str[i++] = lnext;
551          lnext = scan();
552 <        if ((lnext == '-' || lnext == '+') && i < MAXWORD) {
552 >        if ((lnext == '-' | lnext == '+') && i < MAXWORD) {
553              str[i++] = lnext;
554              lnext = scan();
555          }
556 +        if (!isdigit(lnext))
557 +            syntax("missing exponent");
558          while (isdigit(lnext) && i < MAXWORD) {
559              str[i++] = lnext;
560              lnext = scan();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines