diff options
author | John Kohl <jtkohl@mit.edu> | 1988-06-23 06:28:56 +0000 |
---|---|---|
committer | John Kohl <jtkohl@mit.edu> | 1988-06-23 06:28:56 +0000 |
commit | 76a56cff9767ccf9d1e579e808247ef3ad1f5282 (patch) | |
tree | 15a05e875c5e43bf2a739d1f9b15ed3b71c3bb77 /lib/ZReadAscii.c | |
parent | 0a9847711808fbd565b2d1db75525de6e606063f (diff) |
lint fixes
Diffstat (limited to 'lib/ZReadAscii.c')
-rw-r--r-- | lib/ZReadAscii.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/ZReadAscii.c b/lib/ZReadAscii.c index 79dc3f5..b5ead0e 100644 --- a/lib/ZReadAscii.c +++ b/lib/ZReadAscii.c @@ -28,6 +28,7 @@ int ZReadAscii(ptr, len, field, num) { int i; unsigned int hexbyte; + register char c1, c2; for (i=0;i<num;i++) { if (*ptr == ' ') { @@ -41,9 +42,11 @@ int ZReadAscii(ptr, len, field, num) if (len < 0) return (ZERR_BADFIELD); } - hexbyte = (cnvt_xtoi(ptr[0]) << 4) | cnvt_xtoi(ptr[1]); - if (hexbyte < 0) - return (ZERR_BADFIELD); + c1 = cnvt_xtoi(ptr[0]); + c2 = cnvt_xtoi(ptr[1]); + if (c1 < 0 || c2 < 0) + return(ZERR_BADFIELD); + hexbyte = (c1 << 4) | c2; field[i] = hexbyte; ptr += 2; len -= 2; |