You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/12/28 02:42:54 UTC

[incubator-nuttx-apps] branch master updated: fsutils/ipcfg: fix debugassert

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new ced74a0  fsutils/ipcfg: fix debugassert
ced74a0 is described below

commit ced74a064d7d63aafd392373a8e1fc08979353b4
Author: Eero Nurkkala <ee...@offcode.fi>
AuthorDate: Mon Dec 27 15:26:14 2021 +0200

    fsutils/ipcfg: fix debugassert
    
    cppcheck reports the following error:
    
    fsutils/ipcfg/ipcfg_binary.c:332:15: error: Uninitialized variable: fd [uninitvar]
      DEBUGASSERT(fd >= 0 && ipv6cfg != NULL);
    
    Update the DEBUGASSERT() to match that of ipcfg_read_binary_ipv4(). fd is
    uninitilized and doesn't need to be checked here.
    
    Signed-off-by: Eero Nurkkala <ee...@offcode.fi>
---
 fsutils/ipcfg/ipcfg_binary.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fsutils/ipcfg/ipcfg_binary.c b/fsutils/ipcfg/ipcfg_binary.c
index 85baae3..6b7bb96 100644
--- a/fsutils/ipcfg/ipcfg_binary.c
+++ b/fsutils/ipcfg/ipcfg_binary.c
@@ -329,7 +329,7 @@ int ipcfg_read_binary_ipv6(FAR const char *path,
   int fd;
   int ret;
 
-  DEBUGASSERT(fd >= 0 && ipv6cfg != NULL);
+  DEBUGASSERT(path != NULL && ipv6cfg != NULL);
 
   /* Open the file for reading */