acassis commented on code in PR #3110:
URL: https://github.com/apache/nuttx-apps/pull/3110#discussion_r2167415582


##########
system/settings/settings.c:
##########
@@ -1114,26 +1098,18 @@ int settings_create(FAR char *key, enum settings_type_e 
type, ...)
   FAR setting_t *setting = NULL;
   int j;
 
-  if (!g_settings.initialized)
-    {
-      assert(0);
-    }
-
-  assert(type != SETTING_EMPTY);
+  assert(g_settings.initialized);
 
-  assert(strlen(key));
-  if (strlen(key) == 0)
+  if (type == SETTING_EMPTY)
     {
       return -EINVAL;
     }
 
-  assert(strlen(key) < CONFIG_SYSTEM_SETTINGS_KEY_SIZE);
-  if (strlen(key) >= CONFIG_SYSTEM_SETTINGS_KEY_SIZE)
+  if (strlen(key) == 0 || strlen(key) >= CONFIG_SYSTEM_SETTINGS_KEY_SIZE)

Review Comment:
   @TimJTi in this case we will not have (AFAIK) any side effect because there 
is no board modifying the default value of CONFIG_SYSTEM_SETTINGS_VALUE_SIZE. 
So this change will not impact the current status of mainline. Just change in 
nuttx-apps: examples/settings/settings_main.c, include/system/settings.h, 
system/settings/Kconfig, system/settings/readme.md, system/settings/settings.c 
and system/settings/storage_text.c.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to