summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-03-15 15:43:09 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-03-15 15:43:09 +0000
commita47dd1cc261c47b24b8d411c96304add879baf97 (patch)
tree56535882171e2549efd421077f3bd57f445d4d0e /cpukit/libmisc
parent2011-03-15 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-a47dd1cc261c47b24b8d411c96304add879baf97.tar.bz2
2011-03-15 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/shell/main_setenv.c: Revert after discussion. Mark as intentional in Coverity.
Diffstat (limited to 'cpukit/libmisc')
-rw-r--r--cpukit/libmisc/shell/main_setenv.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/cpukit/libmisc/shell/main_setenv.c b/cpukit/libmisc/shell/main_setenv.c
index eb47dddaa8..5b7c92920f 100644
--- a/cpukit/libmisc/shell/main_setenv.c
+++ b/cpukit/libmisc/shell/main_setenv.c
@@ -16,13 +16,6 @@
#include <rtems/shell.h>
#include "internal.h"
-/*
- * Limit examining or copying more than 256 characters at a time.
- * Yes, this is very arbitrary. If there are POSIX constants, then
- * they should be used.
- */
-#define MAX 156
-
int rtems_shell_main_setenv(int argc, char *argv[])
{
char* env = NULL;
@@ -39,7 +32,7 @@ int rtems_shell_main_setenv(int argc, char *argv[])
env = argv[1];
for (arg = 2; arg < argc; arg++)
- len += strnlen(argv[arg], MAX);
+ len += strlen(argv[arg]);
len += argc - 2 - 1;
@@ -51,8 +44,8 @@ int rtems_shell_main_setenv(int argc, char *argv[])
}
for (arg = 2, p = string; arg < argc; arg++) {
- strncpy(p, argv[arg], MAX);
- p += strnlen(argv[arg], MAX);
+ strcpy(p, argv[arg]);
+ p += strlen(argv[arg]);
if (arg < (argc - 1)) {
*p = ' ';
p++;