parser/inpeval.c, use '\0'

This commit is contained in:
rlar 2015-02-28 18:48:17 +01:00
parent a2b5288a3d
commit 4555107013
1 changed files with 5 additions and 5 deletions

View File

@ -50,7 +50,7 @@ double INPevaluate(char **line, int *error, int gobble)
here++; here++;
sign = -1; sign = -1;
} }
if ((*here == 0) || ((!(isdigit(*here))) && (*here != '.'))) { if ((*here == '\0') || ((!(isdigit(*here))) && (*here != '.'))) {
/* number looks like just a sign! */ /* number looks like just a sign! */
*error = 1; *error = 1;
if (gobble) { if (gobble) {
@ -65,7 +65,7 @@ double INPevaluate(char **line, int *error, int gobble)
mantis = 10 * mantis + *here - '0'; mantis = 10 * mantis + *here - '0';
here++; here++;
} }
if (*here == 0) { if (*here == '\0') {
/* reached the end of token - done. */ /* reached the end of token - done. */
if (gobble) { if (gobble) {
FREE(token); FREE(token);
@ -90,7 +90,7 @@ double INPevaluate(char **line, int *error, int gobble)
if (*here == '.') { if (*here == '.') {
/* found a decimal point! */ /* found a decimal point! */
here++; /* skip to next character */ here++; /* skip to next character */
if (*here == 0) { if (*here == '\0') {
/* number ends in the decimal point */ /* number ends in the decimal point */
if (gobble) { if (gobble) {
FREE(token); FREE(token);
@ -103,7 +103,7 @@ double INPevaluate(char **line, int *error, int gobble)
/* digit, so accumulate it. */ /* digit, so accumulate it. */
mantis = 10 * mantis + *here - '0'; mantis = 10 * mantis + *here - '0';
expo1 = expo1 - 1; expo1 = expo1 - 1;
if (*here == 0) { if (*here == '\0') {
/* reached the end of token - done. */ /* reached the end of token - done. */
if (gobble) { if (gobble) {
FREE(token); FREE(token);
@ -169,7 +169,7 @@ double INPevaluate(char **line, int *error, int gobble)
case 'M': case 'M':
{ {
/* special case for m - may be m or mil or meg */ /* special case for m - may be m or mil or meg */
if (here[1] != 0 && here[2] != 0) { if (here[1] != '\0' && here[2] != '\0') {
/* at least 2 characters, so check them. */ /* at least 2 characters, so check them. */
if ((here[1] == 'E') || (here[1] == 'e')) { if ((here[1] == 'E') || (here[1] == 'e')) {
if ((here[2] == 'G') || (here[2] == 'g')) { if ((here[2] == 'G') || (here[2] == 'g')) {