wayland/cursor
Simon Ser 7b27881cd1 cursor: check return value of snprintf()
Fixes a new warning in GCC 7:

    FAILED: cursor/libwayland-cursor.so.0.22.90.p/xcursor.c.o
    cc -Icursor/libwayland-cursor.so.0.22.90.p -Icursor -I../cursor -I. -I.. -Isrc -I../src -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c99 -O3 -D_POSIX_C_SOURCE=200809L -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -fPIC '-DICONDIR="/usr/share/X11/icons"' -MD -MQ cursor/libwayland-cursor.so.0.22.90.p/xcursor.c.o -MF cursor/libwayland-cursor.so.0.22.90.p/xcursor.c.o.d -o cursor/libwayland-cursor.so.0.22.90.p/xcursor.c.o -c ../cursor/xcursor.c
    ../cursor/xcursor.c: In function 'xcursor_load_theme':
    ../cursor/xcursor.c:596:39: error: '%s' directive output between 7 and 7 bytes may cause result to exceed 'INT_MAX' [-Werror=format-truncation=]
      596 |         snprintf(full, full_size, "%s/%s/%s", dir, subdir, file);
          |                                       ^~
    ......
      764 |                 full = xcursor_build_fullname(dir, "cursors", "");
          |                                                    ~~~~~~~~~
    ../cursor/xcursor.c:596:41: error: '/' directive output between 1 and 1 bytes may cause result to exceed 'INT_MAX' [-Werror=format-truncation=]
      596 |         snprintf(full, full_size, "%s/%s/%s", dir, subdir, file);
          |                                         ^
    cc1: all warnings being treated as errors

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-08-02 16:47:07 +02:00
..
convert_font.c cursor/convert_font.c: malloc cannot guarantee that the memory allocated is always successful 2020-10-29 13:00:20 +00:00
cursor-data.h (multiple): Include stdint.h 2016-07-25 18:39:32 -07:00
cursor.pcf cursor: add cursor.pcf and extraction program 2012-09-10 21:05:14 -04:00
meson.build meson: override dependencies to ease use as subproject 2021-12-08 00:27:58 +01:00
os-compatibility.c cursor/os-compatibility: handle EINTR gracefully 2022-06-09 19:18:47 +00:00
os-compatibility.h cursor/os-compatibility: move resizing into a separate function 2020-02-23 20:42:54 +00:00
wayland-cursor.c cursor: make param names match with documentation 2022-09-13 18:01:57 +00:00
wayland-cursor.h cursor: Properly document wl_cursor_image and wl_cursor 2020-06-05 11:05:20 +00:00
xcursor.c cursor: check return value of snprintf() 2023-08-02 16:47:07 +02:00
xcursor.h cursor: rename functions to snake case 2022-05-23 08:59:05 +00:00