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>
This commit is contained in:
Joel Sherrill
2012-02-03 16:05:50 -06:00
parent 935ae4acee
commit fdcf6c11b1

View File

@@ -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) ) {