From 075d56a0cca7a8f0cc58ff3da54a9068a7f87608 Mon Sep 17 00:00:00 2001 From: Dan Egnor <egnor@ofb.net> Date: Mon, 14 Jul 2003 01:01:05 +0000 Subject: [PATCH] Fixes from Per Cederqvist --- sys.c | 3 +++ www.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sys.c b/sys.c index 19bbeb3..b3cf6b1 100644 --- a/sys.c +++ b/sys.c @@ -82,6 +82,7 @@ static oop_source_sys *verify_source(oop_source *source) { static void sys_on_fd(oop_source *source,int fd,oop_event ev, oop_call_fd *f,void *v) { oop_source_sys *sys = verify_source(source); + assert(NULL != f && "callback must be non-NULL"); if (fd >= sys->num_files) { int i,j,num_files = 1 + fd; sys_file *files = oop_malloc(num_files * sizeof(sys_file)); @@ -117,6 +118,7 @@ static void sys_on_time(oop_source *source,struct timeval tv, oop_source_sys *sys = verify_source(source); struct sys_time **p = &sys->time_queue; struct sys_time *time = oop_malloc(sizeof(struct sys_time)); + assert(NULL != f && "callback must be non-NULL"); if (NULL == time) return; /* ugh */ time->tv = tv; time->f = f; @@ -185,6 +187,7 @@ static void sys_on_signal(oop_source *source,int sig, oop_call_signal *f,void *v) { oop_source_sys *sys = verify_source(source); struct sys_signal_handler *handler = oop_malloc(sizeof(*handler)); + assert(NULL != f && "callback must be non-NULL"); if (NULL == handler) return; /* ugh */ assert(sig > 0 && sig < OOP_NUM_SIGNALS && "invalid signal number"); diff --git a/www.c b/www.c index 3dabdef..40ff6fa 100644 --- a/www.c +++ b/www.c @@ -115,7 +115,7 @@ static int reg(SOCKET sock,HTEventType type,HTEvent *www_event) { oop_type = OOP_WRITE; break; case HTEvent_INDEX(HTEvent_OOB): - // XXX: we don't handle this; does anything use it? + /* XXX: we don't handle this; does anything use it? */ return HT_ERROR; default: assert(0 && "invalid HTEvent type specified"); @@ -158,7 +158,7 @@ static int unreg(SOCKET sock,HTEventType type) { oop_type = OOP_WRITE; break; case HTEvent_INDEX(HTEvent_OOB): - // XXX: we don't handle this; does anything use it? + /* XXX: we don't handle this; does anything use it? */ return HT_ERROR; default: assert(0 && "invalid HTEvent type specified"); -- GitLab