mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
Marshall NULL strings correctly
This commit is contained in:
parent
9ccf08d9b8
commit
877d71a6e2
1 changed files with 4 additions and 1 deletions
|
|
@ -400,7 +400,10 @@ wl_connection_vmarshal(struct wl_connection *connection,
|
|||
length = s ? strlen(s) + 1: 0;
|
||||
*p++ = length;
|
||||
|
||||
*sp = (const char *) p;
|
||||
if (length > 0)
|
||||
*sp = (const char *) p;
|
||||
else
|
||||
*sp = NULL;
|
||||
|
||||
memcpy(p, s, length);
|
||||
p += DIV_ROUNDUP(length, sizeof *p);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue