aboutsummaryrefslogtreecommitdiff
path: root/gdb/avr-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/avr-tdep.c')
-rw-r--r--gdb/avr-tdep.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index b14bf83..0bc08a8 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -1468,8 +1468,9 @@ avr_io_reg_read_command (char *args, int from_tty)
{
LONGEST bufsiz = 0;
gdb_byte *buf;
+ const char *bufstr;
char query[400];
- char *p;
+ const char *p;
unsigned int nreg = 0;
unsigned int val;
int i, j, k, step;
@@ -1477,6 +1478,7 @@ avr_io_reg_read_command (char *args, int from_tty)
/* Find out how many io registers the target has. */
bufsiz = target_read_alloc (&current_target, TARGET_OBJECT_AVR,
"avr.io_reg", &buf);
+ bufstr = (const char *) buf;
if (bufsiz <= 0)
{
@@ -1486,7 +1488,7 @@ avr_io_reg_read_command (char *args, int from_tty)
return;
}
- if (sscanf (buf, "%x", &nreg) != 1)
+ if (sscanf (bufstr, "%x", &nreg) != 1)
{
fprintf_unfiltered (gdb_stderr,
_("Error fetching number of io registers\n"));
@@ -1514,7 +1516,7 @@ avr_io_reg_read_command (char *args, int from_tty)
bufsiz = target_read_alloc (&current_target, TARGET_OBJECT_AVR,
query, &buf);
- p = buf;
+ p = (const char *) buf;
for (k = i; k < (i + j); k++)
{
if (sscanf (p, "%[^,],%x;", query, &val) == 2)