From kerberos-acl@MIT.EDU Thu Mar 25 12:53:43 1999 Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id MAA13199 for ; Thu, 25 Mar 1999 12:53:42 -0500 Received: from GRAND-CENTRAL-STATION.MIT.EDU by MIT.EDU with SMTP id AA01428; Thu, 25 Mar 99 12:53:31 EST Received: from melbourne-city-street.MIT.EDU (MELBOURNE-CITY-STREET.MIT.EDU [18.69.0.45]) by grand-central-station.MIT.EDU (8.9.2/8.9.2) with ESMTP id MAA28144 for ; Thu, 25 Mar 1999 12:53:38 -0500 (EST) Received: from nephthys.grey17.org (nephthys.grey17.org [4.255.0.7]) by melbourne-city-street.MIT.EDU (8.9.2/8.9.2) with ESMTP id MAA09787 for ; Thu, 25 Mar 1999 12:53:38 -0500 (EST) Received: by nephthys.grey17.org (8.8.8/4.7) id MAA00968; Thu, 25 Mar 1999 12:53:32 -0500 (EST) Message-Id: <199903251753.MAA00968@nephthys.grey17.org> Date: Thu, 25 Mar 1999 12:53:32 -0500 (EST) From: ghudson@MIT.EDU Reply-To: ghudson@MIT.EDU To: krb5-bugs@MIT.EDU Subject: getchar return value X-Send-Pr-Version: 3.99 >Number: 704 >Category: krb5-libs >Synopsis: getchar returns int >Confidential: no >Severity: non-critical >Priority: medium >Responsible: tlyu >State: closed >Class: sw-bug >Submitter-Id: unknown >Arrival-Date: Thu Mar 25 12:54:01 EST 1999 >Last-Modified: Thu Mar 25 21:57:21 EST 1999 >Originator: Greg Hudson >Organization: MIT >Release: 1.0 >Environment: System: NetBSD nephthys.grey17.org 1.3.2 NetBSD 1.3.2 (ATHENA) #0: Mon Jun 22 17:32:46 EDT 1998 nathanw@antisnork.mit.edu:/u1/var/build/sys-1.3.2/arch/i386/compile/ATHENA i386 >Description: src/lib/krb5/os/promptusr.c uses a char variable for the return value of getchar(), which returns an int (EOF not being a valid char value in all cases). >How-To-Repeat: On a platform with unsigned char, convince krb5_os_get_tty_uio() to flush the rest of a line and have it reach the end of the input stream. Or just get a compiler warning about the comparison between a char value and EOF. >Fix: Index: promptusr.c =================================================================== RCS file: /afs/dev.mit.edu/source/repository/third/krb5/src/lib/krb5/os/promptusr.c,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 promptusr.c *** promptusr.c 1996/09/12 04:45:06 1.1.1.1 --- promptusr.c 1999/03/25 17:49:31 *************** *** 48,54 **** int fd; char read_string[BUFSIZ]; char *cp; ! char ch; /* get the file descriptor associated with stdin */ fd=fileno(stdin); --- 48,54 ---- int fd; char read_string[BUFSIZ]; char *cp; ! int ch; /* get the file descriptor associated with stdin */ fd=fileno(stdin); >Audit-Trail: Responsible-Changed-From-To: krb5-unassigned->tlyu Responsible-Changed-By: tlyu Responsible-Changed-When: Thu Mar 25 21:56:48 1999 Responsible-Changed-Why: State-Changed-From-To: open-closed State-Changed-By: tlyu State-Changed-When: Thu Mar 25 21:57:01 1999 State-Changed-Why: Thanks; patch applied and queued for 1.0.6 >Unformatted: