From fdb4952e5f2db8d245e1be501848282835885701 Mon Sep 17 00:00:00 2001 From: Robert James Kaes Date: Mon, 17 Dec 2001 00:00:24 +0000 Subject: Added the assert() calls to safe_write() to make sure the arguments are sane. --- src/sock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sock.c b/src/sock.c index 67825b9..df35e38 100644 --- a/src/sock.c +++ b/src/sock.c @@ -1,4 +1,4 @@ -/* $Id: sock.c,v 1.20 2001-12-15 20:04:04 rjkaes Exp $ +/* $Id: sock.c,v 1.21 2001-12-17 00:00:24 rjkaes Exp $ * * Sockets are created and destroyed here. When a new connection comes in from * a client, we need to copy the socket and the create a second socket to the @@ -279,6 +279,10 @@ safe_write(int fd, const char *buffer, size_t count) ssize_t len; size_t bytestosend; + assert(fd >= 0); + assert(buffer != NULL); + assert(count > 0); + bytestosend = count; while (1) { -- cgit v1.2.3