diff options
| author | Aleksandr Mezin <mezin.alexander@gmail.com> | 2022-02-09 05:36:11 +0600 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2022-03-25 09:43:53 +0000 |
| commit | 884d5fe3abc98c8b97f71974752ff9f9a3056e8e (patch) | |
| tree | 43cd9746ef1ca29607de6c8f50aec2f6125a4544 /src/wayland-util.c | |
| parent | util: set errno in wl_map_reserve_new() (diff) | |
| download | wayland-884d5fe3abc98c8b97f71974752ff9f9a3056e8e.tar wayland-884d5fe3abc98c8b97f71974752ff9f9a3056e8e.tar.gz wayland-884d5fe3abc98c8b97f71974752ff9f9a3056e8e.tar.bz2 wayland-884d5fe3abc98c8b97f71974752ff9f9a3056e8e.tar.lz wayland-884d5fe3abc98c8b97f71974752ff9f9a3056e8e.tar.xz wayland-884d5fe3abc98c8b97f71974752ff9f9a3056e8e.tar.zst wayland-884d5fe3abc98c8b97f71974752ff9f9a3056e8e.zip | |
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>
Diffstat (limited to 'src/wayland-util.c')
| -rw-r--r-- | src/wayland-util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wayland-util.c b/src/wayland-util.c index ee74bc1..e82b7d2 100644 --- a/src/wayland-util.c +++ b/src/wayland-util.c @@ -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)) |
