summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/system/i2c/i2c_common.c2
-rw-r--r--apps/system/i2c/i2c_main.c4
-rw-r--r--apps/system/i2c/i2ctool.h5
3 files changed, 6 insertions, 5 deletions
diff --git a/apps/system/i2c/i2c_common.c b/apps/system/i2c/i2c_common.c
index a04f7769a..6d5396346 100644
--- a/apps/system/i2c/i2c_common.c
+++ b/apps/system/i2c/i2c_common.c
@@ -187,7 +187,7 @@ int arg_decimal(FAR char **arg, FAR long *value)
{
FAR char *string;
int ret;
-
+
ret = arg_string(arg, &string);
*value = strtol(string, NULL, 10);
return ret;
diff --git a/apps/system/i2c/i2c_main.c b/apps/system/i2c/i2c_main.c
index 85ad90365..7e4a0c91b 100644
--- a/apps/system/i2c/i2c_main.c
+++ b/apps/system/i2c/i2c_main.c
@@ -253,7 +253,7 @@ FAR char *i2c_argument(FAR struct i2ctool_s *i2ctool, int argc, char *argv[], in
int i2c_parse(FAR struct i2ctool_s *i2ctool, int argc, char *argv[])
{
- FAR char *newargs[MAX_ARGUMENTS+1];
+ FAR char *newargs[MAX_ARGUMENTS+2];
FAR char *cmd;
int nargs;
int index;
@@ -278,7 +278,7 @@ int i2c_parse(FAR struct i2ctool_s *i2ctool, int argc, char *argv[])
/* Parse all of the arguments following the command name. */
newargs[0] = cmd;
- for (nargs = 1; nargs < MAX_ARGUMENTS; nargs++)
+ for (nargs = 1; nargs <= MAX_ARGUMENTS; nargs++)
{
newargs[nargs] = i2c_argument(i2ctool, argc, argv, &index);
if (!newargs[nargs])
diff --git a/apps/system/i2c/i2ctool.h b/apps/system/i2c/i2ctool.h
index 5abd731aa..81b7c0682 100644
--- a/apps/system/i2c/i2ctool.h
+++ b/apps/system/i2c/i2ctool.h
@@ -91,10 +91,11 @@
#endif
/* This is the maximum number of arguments that will be accepted for a
- * command
+ * command. The only real limit is in the OS configuration that limits
+ * the number of parameters passed to a task.
*/
-#define MAX_ARGUMENTS 6
+#define MAX_ARGUMENTS (CONFIG_MAX_TASK_ARGS-1)
/* Maximum size of one command line */