mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-31 22:25:25 -04:00
Print NULL strings as "nil" in wl_closure_print
Calling printf("%s", NULL) is undefined behaviour.
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
parent
d325140289
commit
6afb152122
1 changed files with 4 additions and 1 deletions
|
|
@ -1278,7 +1278,10 @@ wl_closure_print(struct wl_closure *closure, struct wl_object *target, int send)
|
|||
wl_fixed_to_double(closure->args[i].f));
|
||||
break;
|
||||
case 's':
|
||||
fprintf(stderr, "\"%s\"", closure->args[i].s);
|
||||
if (closure->args[i].s)
|
||||
fprintf(stderr, "\"%s\"", closure->args[i].s);
|
||||
else
|
||||
fprintf(stderr, "nil");
|
||||
break;
|
||||
case 'o':
|
||||
if (closure->args[i].o)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue