Search
lxdream.org :: lxdream :: r1020:04e622ab1635
lxdream 0.9.1
released Jun 29
Download Now
changeset1020:04e622ab1635
parent1019:87f191f92f8f
child1021:848db285a184
authornkeynes
dateWed Jun 03 11:36:27 2009 +0000 (10 years ago)
Use sscanf correctly
src/gdbserver.c
1.1 --- a/src/gdbserver.c Wed Jun 03 10:29:16 2009 +0000
1.2 +++ b/src/gdbserver.c Wed Jun 03 11:36:27 2009 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: gdbserver.c 1018 2009-03-19 12:29:06Z nkeynes $
1.6 + * $Id$
1.7 *
1.8 * GDB RDP server stub - SH4 + ARM
1.9 *
1.10 @@ -173,8 +173,13 @@
1.11 char *p = buf;
1.12 for( i=firstreg; i < firstreg + regcount; i++ ) {
1.13 uint8_t *val = server->cpu->get_register(i);
1.14 + unsigned int a,b,c,d;
1.15 if( val != NULL ) {
1.16 - sscanf( p, "%02x%02x%02x%02x", val, val+1, val+2, val+3 );
1.17 + sscanf( p, "%02x%02x%02x%02x", &a, &b, &c, &d );
1.18 + val[0] = (uint8_t)a;
1.19 + val[1] = (uint8_t)b;
1.20 + val[2] = (uint8_t)c;
1.21 + val[3] = (uint8_t)d;
1.22 }
1.23 p += 8;
1.24 }
.