summaryrefslogtreecommitdiff
path: root/test/dlwrap.c
diff options
context:
space:
mode:
authorIkey Doherty <ikey@solus-project.com>2017-10-19 16:02:57 +0100
committerIkey Doherty <ikey@solus-project.com>2017-10-19 16:04:11 +0100
commitc8d7ae6bf8f2d0946f8955d1d0f8de3a18306e23 (patch)
tree4240cd6cf8fa28ff43b9d12bd2db898f41d6109b /test/dlwrap.c
parent9dde80065fa09128885d61b0a3baaec780961880 (diff)
downloadlibepoxy-c8d7ae6bf8f2d0946f8955d1d0f8de3a18306e23.tar.gz
Only use printf family when passing arguments
This avoids any unnecessary allocations when simply passing static strings to be printed onto stderr, and uses the simpler fputs mechanism. Signed-off-by: Ikey Doherty <ikey@solus-project.com>
Diffstat (limited to 'test/dlwrap.c')
-rw-r--r--test/dlwrap.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/test/dlwrap.c b/test/dlwrap.c
index 60866db..6861f0b 100644
--- a/test/dlwrap.c
+++ b/test/dlwrap.c
@@ -144,7 +144,7 @@ dlwrap_real_dlopen(const char *filename, int flag)
if (!real_dlopen) {
real_dlopen = (fips_dlopen_t) dlwrap_real_dlsym(RTLD_NEXT, "dlopen");
if (!real_dlopen) {
- fprintf(stderr, "Error: Failed to find symbol for dlopen.\n");
+ fputs("Error: Failed to find symbol for dlopen.\n", stderr);
exit(1);
}
}
@@ -251,22 +251,22 @@ dlwrap_real_dlsym(void *handle, const char *name)
break;
}
if (i == num_versions) {
- fprintf(stderr, "Internal error: Failed to find real dlsym\n");
- fprintf(stderr,
- "This may be a simple matter of fips not knowing about the version of GLIBC that\n"
- "your program is using. Current known versions are:\n\n\t");
+ fputs("Internal error: Failed to find real dlsym\n", stderr);
+ fputs("This may be a simple matter of fips not knowing about the version of GLIBC that\n"
+ "your program is using. Current known versions are:\n\n\t",
+ stderr);
for (i = 0; i < num_versions; i++)
fprintf(stderr, "%s ", version[i]);
- fprintf(stderr,
- "\n\nYou can inspect your version by first finding libdl.so.2:\n"
- "\n"
- "\tldd <your-program> | grep libdl.so\n"
- "\n"
- "And then inspecting the version attached to the dlsym symbol:\n"
- "\n"
- "\treadelf -s /path/to/libdl.so.2 | grep dlsym\n"
- "\n"
- "And finally, adding the version to dlwrap.c:dlwrap_real_dlsym.\n");
+ fputs("\n\nYou can inspect your version by first finding libdl.so.2:\n"
+ "\n"
+ "\tldd <your-program> | grep libdl.so\n"
+ "\n"
+ "And then inspecting the version attached to the dlsym symbol:\n"
+ "\n"
+ "\treadelf -s /path/to/libdl.so.2 | grep dlsym\n"
+ "\n"
+ "And finally, adding the version to dlwrap.c:dlwrap_real_dlsym.\n",
+ stderr);
exit(1);
}