From: Frank Ch. Eigler Date: Tue, 17 Feb 1998 23:14:57 +0000 (+0000) Subject: * remote-mips.c (mips_request): Use unsigned long during parsing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f8611801b1503190ae7d56f7b9b39d64e6b2b964;p=binutils-gdb.git * remote-mips.c (mips_request): Use unsigned long during parsing returned value from monitor, to prevent accidental sign extension. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 702ea22e2d7..1b89f95374e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +Tue Feb 17 18:05:05 1998 Frank Ch. Eigler + + * remote-mips.c (mips_request): Use unsigned long during parsing + returned value from monitor, to prevent accidental sign extension. + Tue Feb 17 14:28:33 1998 Peter Schauer * acconfig.h: FORCE_MMCHECK changed to MMCHECK_FORCE. diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 0d0d5f93573..bdd50c56c29 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -1260,7 +1260,7 @@ mips_request (cmd, addr, data, perr, timeout, buff) int rpid; char rcmd; int rerrflg; - int rresponse; + unsigned long rresponse; if (buff == (char *) NULL) buff = myBuff; @@ -1285,7 +1285,7 @@ mips_request (cmd, addr, data, perr, timeout, buff) len = mips_receive_packet (buff, 1, timeout); buff[len] = '\0'; - if (sscanf (buff, "0x%x %c 0x%x 0x%x", + if (sscanf (buff, "0x%x %c 0x%x 0x%lx", &rpid, &rcmd, &rerrflg, &rresponse) != 4 || (cmd != '\0' && rcmd != cmd)) mips_error ("Bad response from remote board");