Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Feb 2014 14:43:04 +0000
From:      Robert Millan <rmh@freebsd.org>
To:        Baptiste Daroussin <bapt@FreeBSD.org>
Cc:        freebsd-x11@freebsd.org
Subject:   [PATCH] replace isnumber() with isdigit() in X devd backend
Message-ID:  <52EFAAF8.20009@freebsd.org>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------050706020100080101070904
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit


isdigit() is more correct in this case (the input is not locale-dependant),
and also more portable since it is provided on systems with Glibc (e.g.
Debian GNU/kFreeBSD).

-- 
Robert Millan

--------------050706020100080101070904
Content-Type: text/x-patch;
 name="devd_isdigit.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="devd_isdigit.diff"

=== modified file 'devd.c'
--- devd.c	2014-02-03 14:37:49 +0000
+++ devd.c	2014-02-03 14:39:38 +0000
@@ -206,7 +206,7 @@ device_added(char *line)
     for (i = 0; hw_types[i].driver != NULL; i++) {
         if (strncmp(line, hw_types[i].driver,
                     strlen(hw_types[i].driver)) == 0 &&
-            isnumber(*(line + strlen(hw_types[i].driver)))) {
+            isdigit(*(line + strlen(hw_types[i].driver)))) {
 #if XORG_VERSION_CURRENT > 10800000
             attrs.flags |= hw_types[i].flag;
 #endif


--------------050706020100080101070904--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52EFAAF8.20009>