aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test_preload.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/test_preload.c')
-rw-r--r--tests/src/test_preload.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/src/test_preload.c b/tests/src/test_preload.c
index 0ded605..7369035 100644
--- a/tests/src/test_preload.c
+++ b/tests/src/test_preload.c
@@ -1,5 +1,5 @@
/**
- * @file main.c
+ * @file test_preload.c
* @brief Smoke test — call malloc once and print the returned pointer.
*
* Uses write(2) instead of printf to avoid stdio calling malloc
@@ -13,17 +13,17 @@
static void
_s_put_ptr (void *ptr)
{
- const char hex[] = "0123456789abcdef";
+ static const char hex[] = "0123456789abcdef";
char buf[20];
unsigned long v = (unsigned long)ptr;
- int i;
+ size_t i;
if (!ptr)
{
write (1, "(nil)", 5);
return;
}
- i = (int)sizeof (buf);
+ i = sizeof (buf);
while (v)
{
buf[--i] = hex[v % 16];
@@ -31,7 +31,7 @@ _s_put_ptr (void *ptr)
}
buf[--i] = 'x';
buf[--i] = '0';
- write (1, buf + i, (size_t)(sizeof (buf) - i));
+ write (1, buf + i, sizeof (buf) - i);
}
int