Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Nov 2014 08:43:55 +0000 (UTC)
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r275305 - head/sys/boot/i386/boot2
Message-ID:  <201411300843.sAU8htBa038035@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



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