summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2012-02-03 16:05:50 -0600
committerJoel Sherrill <joel.sherrill@oarcorp.com>2012-02-03 16:05:50 -0600
commitfdcf6c11b1aca7bd7185edc7620981f3f49a78f1 (patch)
tree394d168c32016084459fa0f1dc2276dd92e690eb /cpukit
parentUpdate copyright year on manuals to 2012. (diff)
downloadrtems-fdcf6c11b1aca7bd7185edc7620981f3f49a78f1.tar.bz2
PR 2001/shell - medit command argument parsing correction
"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. Author: Werner Almesberger <werner@almesberger.net> Signed-off-by: Sebastien Bourdeauducq <sebastien@milkymist.org>
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libmisc/shell/main_medit.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/cpukit/libmisc/shell/main_medit.c b/cpukit/libmisc/shell/main_medit.c
index d37a1d9a97..beaed75b00 100644
--- a/cpukit/libmisc/shell/main_medit.c
+++ b/cpukit/libmisc/shell/main_medit.c
@@ -8,8 +8,6 @@
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
- *
- * $Id$
*/
#ifdef HAVE_CONFIG_H
@@ -53,7 +51,7 @@ static int rtems_shell_main_medit(
* 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) ) {