diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-06-30 10:15:07 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-06-30 10:15:07 -0400 |
commit | 96d37ecb22d847499fbfab80c62894b64249b8c4 (patch) | |
tree | d988f9911ef54f1810f0aaf802b285434f851c66 /node.c | |
parent | e81d4c05425ee21c44ecef554c216a6760c34c88 (diff) | |
download | egawk-96d37ecb22d847499fbfab80c62894b64249b8c4.tar.gz egawk-96d37ecb22d847499fbfab80c62894b64249b8c4.tar.bz2 egawk-96d37ecb22d847499fbfab80c62894b64249b8c4.zip |
Improve r_force_number coding style.
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -78,15 +78,13 @@ r_force_number(NODE *n) n->numbr = 0.0; /* Trim leading white space, bailing out if there's nothing else */ - cp = n->stptr; - cpend = cp + n->stlen; - while (1) { - if (cp == cpend) - goto badnum; - if (!isspace((unsigned char) *cp)) - break; - cp++; - } + for (cp = n->stptr, cpend = cp + n->stlen; + cp < cpend && isspace((unsigned char) *cp); cp++) + continue; + + if (cp == cpend) + goto badnum; + /* At this point, we know the string is not entirely white space */ /* Trim trailing white space */ while (isspace((unsigned char) cpend[-1])) |