diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-12-22 17:18:52 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-12-22 17:18:52 +0000 |
commit | 7ae9a0283010f2d9acbf6121c412228022c9a1e0 (patch) | |
tree | 5c52e1d8e8c254c0b9b1d484fc06a082f54ea31b | |
parent | 918b923f5bb7286ed02d9c5697215bdaab798030 (diff) |
g/c str_zcpy()
-rw-r--r-- | bin/ksh/misc.c | 19 | ||||
-rw-r--r-- | bin/ksh/proto.h | 3 |
2 files changed, 2 insertions, 20 deletions
diff --git a/bin/ksh/misc.c b/bin/ksh/misc.c index 03c03b053f1..059c368360c 100644 --- a/bin/ksh/misc.c +++ b/bin/ksh/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.25 2004/12/22 17:14:34 millert Exp $ */ +/* $OpenBSD: misc.c,v 1.26 2004/12/22 17:18:51 millert Exp $ */ /* * Miscellaneous functions @@ -1116,23 +1116,6 @@ strip_nuls(char *buf, int nbytes) return nbytes; } -/* Copy at most dsize-1 bytes from src to dst, ensuring dst is null terminated. - * Returns dst. - */ -char * -str_zcpy(char *dst, const char *src, int dsize) -{ - if (dsize > 0) { - int len = strlen(src); - - if (len >= dsize) - len = dsize - 1; - memcpy(dst, src, len); - dst[len] = '\0'; - } - return dst; -} - /* Like read(2), but if read fails due to non-blocking flag, resets flag * and restarts read. */ diff --git a/bin/ksh/proto.h b/bin/ksh/proto.h index d481d58aeb7..5ff22e956aa 100644 --- a/bin/ksh/proto.h +++ b/bin/ksh/proto.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proto.h,v 1.21 2004/12/22 17:14:34 millert Exp $ */ +/* $OpenBSD: proto.h,v 1.22 2004/12/22 17:18:51 millert Exp $ */ /* * prototypes for PD-KSH @@ -192,7 +192,6 @@ void print_value_quoted(const char *); void print_columns(struct shf *, int, char *(*)(void *, int, char *, int), void *, int, int prefcol); int strip_nuls(char *, int); -char *str_zcpy(char *, const char *, int); int blocking_read(int, char *, int); int reset_nonblock(int); char *ksh_get_wd(char *, int); |