This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Fixed unsigned char compare in remote-sds.c
- To: gdb-patches at sources dot redhat dot com
- Subject: [patch] Fixed unsigned char compare in remote-sds.c
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 27 Jun 2001 23:43:35 -0400
Hello,
I've committed the attached fairly obvious fix. On some platforms, CHAR
is unsigned which results in the statement:
int readchar();
char c;
while ((c = readchar()) >= 0)
being pretty useless - ``c'', an unsigned char, is always >= 0.
enjoy,
Andrew
2001-06-27 Andrew Cagney <ac131313@redhat.com>
* remote-sds.c (sds_start_remote): Change type of ``c'' to int
from possibly unsigned char.
Index: remote-sds.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sds.c,v
retrieving revision 1.15
diff -p -r1.15 remote-sds.c
*** remote-sds.c 2001/05/04 04:15:26 1.15
--- remote-sds.c 2001/06/28 03:38:23
*************** sds_close (int quitting)
*** 160,166 ****
static int
sds_start_remote (PTR dummy)
{
! char c;
unsigned char buf[200];
immediate_quit++; /* Allow user to interrupt it */
--- 160,166 ----
static int
sds_start_remote (PTR dummy)
{
! int c;
unsigned char buf[200];
immediate_quit++; /* Allow user to interrupt it */