Browse Source

parser/inpeval.c, use '\0'

pre-master-46
rlar 11 years ago
parent
commit
4555107013
  1. 10
      src/spicelib/parser/inpeval.c

10
src/spicelib/parser/inpeval.c

@ -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')) {

Loading…
Cancel
Save