Mercurial > ~dholland > hg > tradcpp > index.cgi
diff utils.c @ 20:40748b097655
add output.
author | David A. Holland |
---|---|
date | Mon, 20 Dec 2010 04:03:35 -0500 |
parents | c08a947d8f30 |
children | b156910b59b2 |
line wrap: on
line diff
--- a/utils.c Mon Dec 20 03:55:19 2010 -0500 +++ b/utils.c Mon Dec 20 04:03:35 2010 -0500 @@ -108,6 +108,17 @@ return ret; } +char * +dostrndup(const char *s, size_t len) +{ + char *ret; + + ret = domalloc(len+1); + memcpy(ret, s, len); + ret[len] = '\0'; + return ret; +} + size_t notrailingws(char *buf, size_t len) {