[hackers] [sbase] tr: fix "isdigit" check || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Mon, 20 Apr 2015 21:41:16 +0200 (CEST)

commit bfcf46ac5eae942a123498c0aa356ee9f647ba72
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Mon Apr 20 21:17:53 2015 +0200

    tr: fix "isdigit" check

diff --git a/tr.c b/tr.c
index 83d7b69..9ec9640 100644
--- a/tr.c
+++ b/tr.c
_AT_@ -125,14 +125,13 @@ nextbrack:
                                 factor = 1;
                                 base = (rstr[i + 3] == '0') ? 8 : 10;
                                 for (n = j - 1; n > i + 2; n--) {
- if (rstr[n] < '0' && rstr[n] > '9') {
+ if (rstr[n] < '0' || rstr[n] > '9') {
                                                 n = 0;
                                                 break;
                                         }
                                         q += (rstr[n] - '0') * factor;
                                         factor *= base;
                                 }
-
                                 if (n == 0) {
                                         j = m + 1;
                                         goto nextbrack;
Received on Mon Apr 20 2015 - 21:41:16 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 20 2015 - 21:48:10 CEST