This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] Fixed unsigned char compare in remote-sds.c


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 */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]