mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
connection: fix signedness warnings
Fix two of warning: comparison between signed and unsigned integer expressions If the pointer difference somehow ended up negative, these comparisons would break as the difference was implicitly casted to unsigned. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
parent
3b7cdcb5c6
commit
80cf9cb44d
1 changed files with 2 additions and 2 deletions
|
|
@ -428,7 +428,7 @@ wl_connection_vmarshal(struct wl_connection *connection,
|
|||
|
||||
s = va_arg(ap, const char *);
|
||||
length = s ? strlen(s) + 1: 0;
|
||||
if (end - p < DIV_ROUNDUP(length, sizeof *p) + 1)
|
||||
if (end - p < (int)DIV_ROUNDUP(length, sizeof *p) + 1)
|
||||
goto err;
|
||||
*p++ = length;
|
||||
|
||||
|
|
@ -478,7 +478,7 @@ wl_connection_vmarshal(struct wl_connection *connection,
|
|||
*p++ = 0;
|
||||
break;
|
||||
}
|
||||
if (end - p < DIV_ROUNDUP(array->size, sizeof *p) + 1)
|
||||
if (end - p < (int)DIV_ROUNDUP(array->size, sizeof *p) + 1)
|
||||
goto err;
|
||||
*p++ = array->size;
|
||||
memcpy(p, array->data, array->size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue