aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-mips.c
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>1998-02-17 23:14:57 +0000
committerFrank Ch. Eigler <fche@redhat.com>1998-02-17 23:14:57 +0000
commitf8611801b1503190ae7d56f7b9b39d64e6b2b964 (patch)
tree5e2bcbd496e0cd2eaf23be7a26107d67effa4db8 /gdb/remote-mips.c
parentdd6007359647d3873d1cb777660b7e0ef0b9352f (diff)
downloadgdb-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/remote-mips.c')
-rw-r--r--gdb/remote-mips.c4
1 files changed, 2 insertions, 2 deletions
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");