fix asprintf warnings
Fix recently introduced compiler warnings:
desktop-shell/shell.c: In function 'shell_configuration':
desktop-shell/shell.c:588:10: warning: ignoring return value of
'asprintf', declared with attribute warn_unused_result [-Wunused-result]
src/screenshooter.c: In function ‘screenshooter_binding’:
src/screenshooter.c:291:10: warning: ignoring return value of
‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
src/text-backend.c: In function ‘text_backend_configuration’:
src/text-backend.c:944:10: warning: ignoring return value of ‘asprintf’,
declared with attribute warn_unused_result [-Wunused-result]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 6103309..234849a 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -575,6 +575,7 @@
struct weston_config_section *section;
int duration;
char *s, *client;
+ int ret;
section = weston_config_get_section(shell->compositor->config,
"screensaver", NULL, NULL);
@@ -585,8 +586,10 @@
section = weston_config_get_section(shell->compositor->config,
"shell", NULL, NULL);
- asprintf(&client, "%s/%s", weston_config_get_libexec_dir(),
- WESTON_SHELL_CLIENT);
+ ret = asprintf(&client, "%s/%s", weston_config_get_libexec_dir(),
+ WESTON_SHELL_CLIENT);
+ if (ret < 0)
+ client = NULL;
weston_config_section_get_string(section,
"client", &s, client);
free(client);