[hackers] [scc] [cc1] Increase the portability of digits() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 11 May 2016 12:23:45 +0200 (CEST)

commit 8d908c4c320555aaef7fccc0e5c9399940dfe842
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed May 11 12:20:47 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed May 11 12:20:47 2016 +0200

    [cc1] Increase the portability of digits()
    
    This is a bit (totally) pedantic, but we were using the strchr approach
    in readint, so it was a bit stupid don't being pedantic in digits() to.

diff --git a/cc1/lex.c b/cc1/lex.c
index bcd707a..72342b7 100644
--- a/cc1/lex.c
+++ b/cc1/lex.c
_AT_@ -354,7 +354,7 @@ digits(unsigned base)
         for (p = input->p; c = *p; ++p) {
                 switch (base) {
                 case 8:
- if (c > '7' || c < '0')
+ if (!strchr("01234567", c))
                                 goto end;
                         break;
                 case 10:
Received on Wed May 11 2016 - 12:23:45 CEST

This archive was generated by hypermail 2.3.0 : Wed May 11 2016 - 12:24:15 CEST