Author: rdivacky
Date: Sun Nov 30 08:43:55 2014
New Revision: 275305
URL: https://svnweb.freebsd.org/changeset/base/275305

Log:
  Unbreak the code for non-digits below '0' by casting the expression
  to unsigned int.
  
  Pointed out by: bde

Modified:
  head/sys/boot/i386/boot2/boot2.c

Modified: head/sys/boot/i386/boot2/boot2.c
==============================================================================
--- head/sys/boot/i386/boot2/boot2.c    Sun Nov 30 08:34:46 2014        
(r275304)
+++ head/sys/boot/i386/boot2/boot2.c    Sun Nov 30 08:43:55 2014        
(r275305)
@@ -418,7 +418,7 @@ parse()
 #if SERIAL
                } else if (c == 'S') {
                    j = 0;
-                   while ((i = *arg++ - '0') <= 9)
+                   while ((unsigned int)(i = *arg++ - '0') <= 9)
                        j = j * 10 + i;
                    if (j > 0 && i == -'0') {
                        comspeed = j;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to