client: Fix some compiler warnings
PATCH 1/1 client: Fix some compiler warnings
Fix some warnings reported by GCC 10.2.0:
* NULL pointer passed to '%s' format string parameter:
pseudo_client.c: In function ‘pseudo_root_path’:
pseudo_client.c:848:3: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
848 | pseudo_diag("couldn't allocate absolute path for '%s'.\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
849 | path);* Return of variable with local storage duration:
pseudo_client.c: In function ‘pseudo_client_op’:
cc1: warning: function may return address of local variable [-Wreturn-local-addr]
pseudo_client.c:1592:15: note: declared here
1592 | pseudo_msg_t msg = { .type = PSEUDO_MSG_OP };
Signed-off-by Philip Lorenz <[email protected]>
--- pseudo_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
pseudo_client.c +2 -2
@@ -846,7 +846,7 @@ pseudo_root_path(const char *func, int line, int dirfd, const char *path, int lepseudo_magic ();if (!rc) {pseudo_diag ("couldn't allocate absolute path for '%s'.\n" , - path); + path ? path :"null" ); } pseudo_debug(PDBGF_CHROOT, "root_path [%s, %d]: '%s' from '%s'\n", func, line,
@@ -1589,7 +1589,7 @@ int pseudo_client_ignore_path(const char *path) {pseudo_msg_t *pseudo_client_op (pseudo_op_t op,int access,int fd,int dirfd,const char *path,const PSEUDO_STATBUF *buf, ...) {pseudo_msg_t *result =0 ; -pseudo_msg_t msg = { .type =PSEUDO_MSG_OP }; +static pseudo_msg_t msg = { .type =PSEUDO_MSG_OP };size_t pathlen =-1 ;int do_request =0 ;char *path_extra_1 =0 ;
Signature · 1 line
2.31.1