[rtems commit] 2001/shell - medit command argument parsing correction

Joel Sherrill joel at rtems.org
Fri Feb 3 22:24:04 UTC 2012


Module:    rtems
Branch:    4.9
Commit:    750ff7689d7c5f770e2b0716f3a0290c468b9da1
Changeset: http://git.rtems.org/rtems/commit/?id=750ff7689d7c5f770e2b0716f3a0290c468b9da1

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Fri Feb  3 16:21:53 2012 -0600

 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 at almesberger.net>
Signed-off-by: Sebastien Bourdeauducq <sebastien at milkymist.org>

---

 cpukit/libmisc/shell/main_medit.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/cpukit/libmisc/shell/main_medit.c b/cpukit/libmisc/shell/main_medit.c
index 2e590d4..99995c8 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
@@ -42,7 +40,7 @@ int rtems_shell_main_medit(
   pb = (unsigned char*)rtems_shell_str2int(argv[1]);
   i = 2;
   n = 0;
-  while (i<=argc) {
+  while (i<argc) {
     pb[n++] = rtems_shell_str2int(argv[i++]) % 0x100;
   }
 




More information about the vc mailing list