diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2002-04-15 04:13:14 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2002-04-15 04:13:14 +0000 |
commit | f0b686199805c70780565d736158496af301320f (patch) | |
tree | 6dd884bd1861c62bde4d57e01bfbed23d8196b2f | |
parent | a5d32127517010c7d09f669aff613e98057ea6b4 (diff) |
Added an assert() call to detect design errors.
-rw-r--r-- | src/utils.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/utils.c b/src/utils.c index d99abaf..4d98c5f 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1,4 +1,4 @@ -/* $Id: utils.c,v 1.23 2002-04-15 02:07:27 rjkaes Exp $ +/* $Id: utils.c,v 1.24 2002-04-15 04:13:14 rjkaes Exp $ * * Misc. routines which are used by the various functions to handle strings * and memory allocation and pretty much anything else we can think of. Also, @@ -387,7 +387,11 @@ strlcat(char *dst, const char *src, size_t size) size_t chomp(char *buffer, size_t length) { - size_t chars = 0; + size_t chars; + + assert(buffer != NULL); + + chars = 0; --length; while (buffer[length] == '\r' || buffer[length] == '\n') { |