aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common.c b/src/common.c
index 198bc1b..8805d89 100644
--- a/src/common.c
+++ b/src/common.c
@@ -434,6 +434,9 @@ slapt_vector_t *slapt_vector_t_init(slapt_vector_t_free_function f)
void slapt_vector_t_free(slapt_vector_t *v)
{
+ if (!v)
+ return;
+
if (v->free_function) {
for (uint32_t i = 0; i < v->size; i++) {
v->free_function(v->items[i]);
@@ -570,7 +573,7 @@ size_t slapt_strlcpy(char *dst, const char *src, size_t size)
size_t src_length = strnlen (src, size);
if (src_length >= size) {
if (src_length != size) {
- fprintf(stderr, "Truncating %s [%ld to %ld]\n", src, size, src_length);
+ fprintf(stderr, "Truncating %s [%zd to %zd]\n", src, size, src_length);
exit(EXIT_FAILURE);
}
memcpy (dst, src, size);