pkarashchenko commented on code in PR #6423:
URL: https://github.com/apache/incubator-nuttx/pull/6423#discussion_r895827664
##########
sched/environ/env_unsetenv.c:
##########
@@ -61,23 +61,30 @@ int unsetenv(FAR const char *name)
{
FAR struct tcb_s *rtcb = this_task();
FAR struct task_group_s *group = rtcb->group;
- int ret = OK;
+ int idx;
- DEBUGASSERT(name && group);
+ DEBUGASSERT(group);
+
+ /* Check the incoming parameter */
+
+ if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
Review Comment:
I'm not sure. We can leave `NULL` check as `EINVAL`. That makes sense. I
just was thinking that POSIX states nothing about NULL case, but only covers
empty string and `'='` holder string. I'm fine to keep the `NULL` check as
recoverable error. Not sure how Linux manages that.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]