diff options
author | Frank Ch. Eigler <fche@redhat.com> | 1998-02-17 23:14:57 +0000 |
---|---|---|
committer | Frank Ch. Eigler <fche@redhat.com> | 1998-02-17 23:14:57 +0000 |
commit | f8611801b1503190ae7d56f7b9b39d64e6b2b964 (patch) | |
tree | 5e2bcbd496e0cd2eaf23be7a26107d67effa4db8 /gdb | |
parent | dd6007359647d3873d1cb777660b7e0ef0b9352f (diff) | |
download | gdb-f8611801b1503190ae7d56f7b9b39d64e6b2b964.zip gdb-f8611801b1503190ae7d56f7b9b39d64e6b2b964.tar.gz gdb-f8611801b1503190ae7d56f7b9b39d64e6b2b964.tar.bz2 |
* remote-mips.c (mips_request): Use unsigned long during parsing
returned value from monitor, to prevent accidental sign extension.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/remote-mips.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 702ea22..1b89f95 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +Tue Feb 17 18:05:05 1998 Frank Ch. Eigler <fche@cygnus.com> + + * 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 <pes@regent.e-technik.tu-muenchen.de> * acconfig.h: FORCE_MMCHECK changed to MMCHECK_FORCE. diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 0d0d5f9..bdd50c5 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"); |