X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=secnet.git;a=blobdiff_plain;f=util.c;h=24dd9a33ebfb375ea3047425e83b8c8bc6b376c2;hp=1b46bc0df7422fe0bc6fdc2c3a91c0da51dba673;hb=779837e133a4740798015a1d7de6fbf6b4b1720f;hpb=8534d6023d74efac11d7e2b5d1903638f3c1eca3 diff --git a/util.c b/util.c index 1b46bc0..24dd9a3 100644 --- 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; }