Re: [OE-core] [PATCH 3/6] pseudo_client: Do not pass null argument to pseudo_diag()

2021-09-09 Thread Seebs
On Thu,  9 Sep 2021 16:36:11 +0100
Richard Purdie  wrote:

>  pseudo_client.c:848:17: warning: ‘%s’ directive argument is null
> [-Wformat-overflow=] 848 | pseudo_diag("couldn't
> allocate absolute path for '%s'.\n",

I'm sort of curious as to whether pseudo_root_path is ever actually
called on a null path, but eh, checks are cheap.

-s

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155863): 
https://lists.openembedded.org/g/openembedded-core/message/155863
Mute This Topic: https://lists.openembedded.org/mt/85487316/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH 3/6] pseudo_client: Do not pass null argument to pseudo_diag()

2021-09-09 Thread Richard Purdie
From: Damian Wrobel 

Fixes the following warning:

 pseudo_client.c: In function ‘pseudo_root_path’:
 pseudo_client.c:848:17: warning: ‘%s’ directive argument is null 
[-Wformat-overflow=]
   848 | pseudo_diag("couldn't allocate absolute path for 
'%s'.\n",
   | 
^~
   849 | path);
   | ~

Signed-off-by: Damian Wrobel 
Signed-off-by: Richard Purdie 
---
 pseudo_client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pseudo_client.c b/pseudo_client.c
index 579db33..2583bca 100644
--- a/pseudo_client.c
+++ b/pseudo_client.c
@@ -846,7 +846,7 @@ pseudo_root_path(const char *func, int line, int dirfd, 
const char *path, int le
pseudo_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,
-- 
2.32.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155857): 
https://lists.openembedded.org/g/openembedded-core/message/155857
Mute This Topic: https://lists.openembedded.org/mt/85487316/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-