chiark / gitweb /
Use FORMAT everywhere, and fix up the errors it finds
[secnet.git] / util.c
diff --git a/util.c b/util.c
index 1b46bc0df7422fe0bc6fdc2c3a91c0da51dba673..24dd9a33ebfb375ea3047425e83b8c8bc6b376c2 100644 (file)
--- a/util.c
+++ b/util.c
@@ -61,7 +61,7 @@ char *safe_strdup(const char *s, const char *message)
     char *d;
     d=strdup(s);
     if (!d) {
-       fatal_perror(message);
+       fatal_perror("%s",message);
     }
     return d;
 }
@@ -71,7 +71,7 @@ void *safe_malloc(size_t size, const char *message)
     void *r;
     r=malloc(size);
     if (!r) {
-       fatal_perror(message);
+       fatal_perror("%s",message);
     }
     return r;
 }
@@ -208,7 +208,7 @@ bool_t remove_hook(uint32_t phase, hook_fn *fn, void *state)
 
 void vslilog(struct log_if *lf, int priority, const char *message, va_list ap)
 {
-    lf->vlog(lf->st,priority,message,ap);
+    lf->vlogfn(lf->st,priority,message,ap);
 }
 
 void slilog(struct log_if *lf, int priority, const char *message, ...)
@@ -247,6 +247,7 @@ void buffer_assert_used(struct buffer_if *buffer, cstring_t file,
 
 void buffer_init(struct buffer_if *buffer, int32_t max_start_pad)
 {
+    assert(max_start_pad<=buffer->len);
     buffer->start=buffer->base+max_start_pad;
     buffer->size=0;
 }