mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-01 22:58:40 -04:00
util: set errno in wl_map_insert_at()
And add errno checks in callers, where it seems to be necessary. Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
This commit is contained in:
parent
03e8a1f84b
commit
884d5fe3ab
3 changed files with 18 additions and 9 deletions
|
|
@ -239,8 +239,10 @@ wl_map_insert_at(struct wl_map *map, uint32_t flags, uint32_t i, void *data)
|
|||
}
|
||||
|
||||
count = entries->size / sizeof *start;
|
||||
if (count < i)
|
||||
if (count < i) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (count == i) {
|
||||
if (!wl_array_add(entries, sizeof *start))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue