Root/m1/patches/rtems/mem-fixes.patch

1This patch fixes the "mdump" and "medit" shell commands:
2
3- "mdump" got the length argument wrong and would only produce useful
4  output if it was omitted.
5
6- "medit" overran the argument list, choking on the NULL pointer
7  following the last argument.
8
9Note that "medit" still only does byte-sized accesses, which limits
10its usefulness on most systems.
11
12- Werner
13
14Index: rtems/cpukit/libmisc/shell/main_mdump.c
15===================================================================
16--- rtems.orig/cpukit/libmisc/shell/main_mdump.c 2012-01-25 21:48:05.000000000 -0300
17+++ rtems/cpukit/libmisc/shell/main_mdump.c 2012-01-25 21:48:27.000000000 -0300
18@@ -47,8 +47,8 @@
19   }
20 
21   if (argc > 2) {
22- if ( rtems_string_to_int(argv[1], &max, NULL, 0) ) {
23- printf( "Length argument (%s) is not a number\n", argv[1] );
24+ if ( rtems_string_to_int(argv[2], &max, NULL, 0) ) {
25+ printf( "Length argument (%s) is not a number\n", argv[2] );
26       return -1;
27     }
28     if (max <= 0) {
29Index: rtems/cpukit/libmisc/shell/main_medit.c
30===================================================================
31--- rtems.orig/cpukit/libmisc/shell/main_medit.c 2012-01-25 21:48:30.000000000 -0300
32+++ rtems/cpukit/libmisc/shell/main_medit.c 2012-01-25 21:50:30.000000000 -0300
33@@ -55,7 +55,7 @@
34    * Now edit the memory
35    */
36   n = 0;
37- for (i=2 ; i<=argc ; i++) {
38+ for (i=2 ; i<argc ; i++) {
39     unsigned char tmpc;
40 
41     if ( rtems_string_to_unsigned_char(argv[i], &tmpc, NULL, 0) ) {
42

Archive Download this file

Branches:
master



interactive