1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 03:15:19 +02:00

m1/patches/rtems/mem-fixes.patch: fix mdump and medit shell commands

This commit is contained in:
Werner Almesberger 2012-01-25 22:06:12 -03:00
parent b13b4e8b81
commit 19462f4aa5
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,41 @@
This patch fixes the "mdump" and "medit" shell commands:
- "mdump" got the length argument wrong and would only produce useful
output if it was omitted.
- "medit" overran the argument list, choking on the NULL pointer
following the last argument.
Note that "medit" still only does byte-sized accesses, which limits
its usefulness on most systems.
- Werner
Index: rtems/cpukit/libmisc/shell/main_mdump.c
===================================================================
--- rtems.orig/cpukit/libmisc/shell/main_mdump.c 2012-01-25 21:48:05.000000000 -0300
+++ rtems/cpukit/libmisc/shell/main_mdump.c 2012-01-25 21:48:27.000000000 -0300
@@ -47,8 +47,8 @@
}
if (argc > 2) {
- if ( rtems_string_to_int(argv[1], &max, NULL, 0) ) {
- printf( "Length argument (%s) is not a number\n", argv[1] );
+ if ( rtems_string_to_int(argv[2], &max, NULL, 0) ) {
+ printf( "Length argument (%s) is not a number\n", argv[2] );
return -1;
}
if (max <= 0) {
Index: rtems/cpukit/libmisc/shell/main_medit.c
===================================================================
--- rtems.orig/cpukit/libmisc/shell/main_medit.c 2012-01-25 21:48:30.000000000 -0300
+++ rtems/cpukit/libmisc/shell/main_medit.c 2012-01-25 21:50:30.000000000 -0300
@@ -55,7 +55,7 @@
* Now edit the memory
*/
n = 0;
- for (i=2 ; i<=argc ; i++) {
+ for (i=2 ; i<argc ; i++) {
unsigned char tmpc;
if ( rtems_string_to_unsigned_char(argv[i], &tmpc, NULL, 0) ) {

View File

@ -17,3 +17,4 @@
milkymist-usb-midi.patch
#milkymist-midi-opt.patch - applied 2011-12-06
fix-ftpd-root.patch
mem-fixes.patch