Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/stand/misc avoid calling toupper with posibly ...



details:   https://anonhg.NetBSD.org/src/rev/9b801fc52c96
branches:  trunk
changeset: 545678:9b801fc52c96
user:      dsl <dsl%NetBSD.org@localhost>
date:      Mon Apr 14 11:33:40 2003 +0000

description:
avoid calling toupper with posibly -ve value. fixes PR 21171

diffstat:

 sys/arch/i386/stand/misc/rawrite.c |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (13 lines):

diff -r eabde0068ad8 -r 9b801fc52c96 sys/arch/i386/stand/misc/rawrite.c
--- a/sys/arch/i386/stand/misc/rawrite.c        Mon Apr 14 10:18:37 2003 +0000
+++ b/sys/arch/i386/stand/misc/rawrite.c        Mon Apr 14 11:33:40 2003 +0000
@@ -142,8 +142,7 @@
 
   printf("Enter destination drive: ");
   scanf("%s", fname);
-  drive = fname[0];
-  drive = (islower(drive) ? toupper(drive) : drive) - 'A';
+  drive = (fname[0] - 'A') & 0xf;
   printf("Please insert a formatted diskette into ");
   printf("drive %c: and press -ENTER- :", drive + 'A');
   while (bioskey(1) == 0) ;                            /* Wait...      */



Home | Main Index | Thread Index | Old Index