mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-11 05:34:41 -04:00
src: switch asserts to wl_abort
assert()s can be compiled away by #defining NDEBUG. Some build systems do this. Using wl_abort gives a human readable error message and it isn't compiled away. This commit closes issue #230. Signed-off-by: meltq <tejasvipin76@gmail.com>
This commit is contained in:
parent
fa1811ce3e
commit
0cecde304f
5 changed files with 36 additions and 16 deletions
|
|
@ -1714,7 +1714,8 @@ wl_socket_init_for_display_name(struct wl_socket *s, const char *name)
|
|||
name_size = snprintf(s->addr.sun_path, sizeof s->addr.sun_path,
|
||||
"%s%s%s", runtime_dir, separator, name) + 1;
|
||||
|
||||
assert(name_size > 0);
|
||||
if (!(name_size > 0))
|
||||
wl_abort("Error assigning path name for socket address\n");
|
||||
if (name_size > (int)sizeof s->addr.sun_path) {
|
||||
wl_log("error: socket path \"%s%s%s\" plus null terminator"
|
||||
" exceeds 108 bytes\n", runtime_dir, separator, name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue