~mdw
/
secnet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use FORMAT everywhere, and fix up the errors it finds
[secnet]
/
util.c
diff --git
a/util.c
b/util.c
index
1b46bc0
..
24dd9a3
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) {
char *d;
d=strdup(s);
if (!d) {
- fatal_perror(message);
+ fatal_perror(
"%s",
message);
}
return d;
}
}
return d;
}
@@
-71,7
+71,7
@@
void *safe_malloc(size_t size, const char *message)
void *r;
r=malloc(size);
if (!r) {
void *r;
r=malloc(size);
if (!r) {
- fatal_perror(message);
+ fatal_perror(
"%s",
message);
}
return r;
}
}
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)
{
void vslilog(struct log_if *lf, int priority, const char *message, va_list ap)
{
- lf->vlog(lf->st,priority,message,ap);
+ lf->vlog
fn
(lf->st,priority,message,ap);
}
void slilog(struct log_if *lf, int priority, const char *message, ...)
}
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)
{
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;
}
buffer->start=buffer->base+max_start_pad;
buffer->size=0;
}