summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIkey Doherty <ikey@solus-project.com>2017-10-19 15:50:46 +0100
committerIkey Doherty <ikey@solus-project.com>2017-10-19 15:52:01 +0100
commit9dde80065fa09128885d61b0a3baaec780961880 (patch)
treed5985e6aeba4a5bc4101052d45dd9f72b10b20ba /test
parent1b54e263eb112030b59c06f5daed0f75c8653cf3 (diff)
downloadlibepoxy-9dde80065fa09128885d61b0a3baaec780961880.tar.gz
test: Fix trivial compiler warning in dlwrap
This mutes compiler warnings for `dlwrap.c` by ensuring we actually check the return status of the `asprintf` call. At this point in the test suite our possible failure here is only memory, so we'll abort. Signed-off-by: Ikey Doherty <ikey@solus-project.com>
Diffstat (limited to 'test')
-rw-r--r--test/dlwrap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/dlwrap.c b/test/dlwrap.c
index c5d447b..60866db 100644
--- a/test/dlwrap.c
+++ b/test/dlwrap.c
@@ -162,7 +162,11 @@ wrapped_dlsym(const char *prefix, const char *name)
char *wrap_name;
void *symbol;
- asprintf(&wrap_name, "override_%s_%s", prefix, name);
+ if (asprintf(&wrap_name, "override_%s_%s", prefix, name) < 0) {
+ fputs("Error: Failed to allocate memory.\n", stderr);
+ abort();
+ }
+
symbol = dlwrap_real_dlsym(RTLD_DEFAULT, wrap_name);
free(wrap_name);
return symbol;