summaryrefslogtreecommitdiff
path: root/tests/util
diff options
context:
space:
mode:
Diffstat (limited to 'tests/util')
-rw-r--r--tests/util/messages-t.c4
-rw-r--r--tests/util/xmalloc.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/tests/util/messages-t.c b/tests/util/messages-t.c
index fb82a42..a58f82c 100644
--- a/tests/util/messages-t.c
+++ b/tests/util/messages-t.c
@@ -146,8 +146,8 @@ test_strerror(int status, const char *output, int error,
char *full_output, *name;
full_output = concat(output, ": ", strerror(error), "\n", (char *) NULL);
- xasprintf(&name, "strerror %d", testnum / 3 + 1);
- is_function_output(function, status, full_output, name);
+ xasprintf(&name, "strerror %lu", testnum / 3 + 1);
+ is_function_output(function, status, full_output, "%s", name);
free(full_output);
free(name);
}
diff --git a/tests/util/xmalloc.c b/tests/util/xmalloc.c
index 3bd5588..b6f4564 100644
--- a/tests/util/xmalloc.c
+++ b/tests/util/xmalloc.c
@@ -246,8 +246,6 @@ main(int argc, char *argv[])
size_t limit = 0;
int willfail = 0;
unsigned char code;
- struct rlimit rl;
- void *tmp;
if (argc < 3)
die("Usage error. Type, size, and limit must be given.");
@@ -290,6 +288,9 @@ main(int argc, char *argv[])
*/
if (limit > 0) {
#if HAVE_SETRLIMIT && defined(RLIMIT_AS)
+ struct rlimit rl;
+ void *tmp;
+
rl.rlim_cur = limit;
rl.rlim_max = limit;
if (setrlimit(RLIMIT_AS, &rl) < 0) {