diff --git a/distrib/sets/lists/base/shl.mi b/distrib/sets/lists/base/shl.mi index 37a74d93f082..e29d6f1166f7 100644 --- a/distrib/sets/lists/base/shl.mi +++ b/distrib/sets/lists/base/shl.mi @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.392 2007/05/30 16:23:23 tls Exp $ +# $NetBSD: shl.mi,v 1.393 2007/07/01 21:41:17 pooka Exp $ # Note: libtermcap and libtermlib are hardlinked and share the same version. ./lib/libc.so.12.150 base-sys-shlib ./lib/libcrypt.so.0.2 base-sys-shlib @@ -12,7 +12,7 @@ ./lib/libradius.so.1.0 base-sys-shlib ./lib/libtermcap.so.0.6 base-sys-shlib ./lib/libtermlib.so.0.6 base-sys-shlib -./lib/libutil.so.7.13 base-sys-shlib +./lib/libutil.so.7.14 base-sys-shlib ./lib/libz.so.1.0 base-sys-shlib ./usr/lib/i18n/libBIG5.so.4.4 base-i18n-shlib ./usr/lib/i18n/libDECHanyu.so.4.4 base-i18n-shlib @@ -108,7 +108,7 @@ ./usr/lib/libtermcap.so.0.6 base-sys-shlib ./usr/lib/libtermlib.so.0.6 base-sys-shlib ./usr/lib/libusbhid.so.1.0 base-sys-shlib -./usr/lib/libutil.so.7.13 base-sys-shlib +./usr/lib/libutil.so.7.14 base-sys-shlib ./usr/lib/libwrap.so.0.2 base-net-shlib ./usr/lib/libz.so.1.0 base-sys-shlib ./usr/lib/security/pam_afslog.so.0 base-sys-shlib kerberos,pam diff --git a/distrib/sets/lists/comp/mi b/distrib/sets/lists/comp/mi index cf5b19779a43..3f92dbfa3ace 100644 --- a/distrib/sets/lists/comp/mi +++ b/distrib/sets/lists/comp/mi @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1038 2007/07/01 07:55:52 xtraeme Exp $ +# $NetBSD: mi,v 1.1039 2007/07/01 21:41:16 pooka Exp $ ./etc/mtree/set.comp comp-sys-root ./usr/bin/addr2line comp-debug-bin bfd ./usr/bin/ar comp-util-bin bfd @@ -4398,6 +4398,7 @@ ./usr/share/man/cat3/errx.0 comp-c-catman .cat ./usr/share/man/cat3/esetfunc.0 comp-c-catman .cat ./usr/share/man/cat3/estrdup.0 comp-c-catman .cat +./usr/share/man/cat3/estrndup.0 comp-c-catman .cat ./usr/share/man/cat3/estrlcat.0 comp-c-catman .cat ./usr/share/man/cat3/estrlcpy.0 comp-c-catman .cat ./usr/share/man/cat3/etext.0 comp-c-catman .cat @@ -8739,6 +8740,7 @@ ./usr/share/man/man3/errx.3 comp-c-man .man ./usr/share/man/man3/esetfunc.3 comp-c-man .man ./usr/share/man/man3/estrdup.3 comp-c-man .man +./usr/share/man/man3/estrndup.3 comp-c-man .man ./usr/share/man/man3/estrlcat.3 comp-c-man .man ./usr/share/man/man3/estrlcpy.3 comp-c-man .man ./usr/share/man/man3/etext.3 comp-c-man .man diff --git a/include/util.h b/include/util.h index 79c8039606a3..0b03c5f85069 100644 --- a/include/util.h +++ b/include/util.h @@ -1,4 +1,4 @@ -/* $NetBSD: util.h,v 1.45 2006/12/14 19:18:01 christos Exp $ */ +/* $NetBSD: util.h,v 1.46 2007/07/01 21:41:16 pooka Exp $ */ /*- * Copyright (c) 1995 @@ -132,6 +132,7 @@ void (*esetfunc(void (*)(int, const char *, ...))) size_t estrlcpy(char *, const char *, size_t); size_t estrlcat(char *, const char *, size_t); char *estrdup(const char *); +char *estrndup(const char *, size_t); void *ecalloc(size_t, size_t); void *emalloc(size_t); void *erealloc(void *, size_t); diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile index 4113c48465d2..0782c7e75481 100644 --- a/lib/libutil/Makefile +++ b/lib/libutil/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.54 2006/12/14 19:18:01 christos Exp $ +# $NetBSD: Makefile,v 1.55 2007/07/01 21:41:16 pooka Exp $ # @(#)Makefile 8.1 (Berkeley) 6/4/93 USE_SHLIBDIR= yes @@ -61,6 +61,7 @@ MLINKS+=efun.3 easprintf.3 MLINKS+=efun.3 estrlcpy.3 MLINKS+=efun.3 estrlcat.3 MLINKS+=efun.3 estrdup.3 +MLINKS+=efun.3 estrndup.3 MLINKS+=efun.3 emalloc.3 MLINKS+=efun.3 ecalloc.3 MLINKS+=efun.3 erealloc.3 diff --git a/lib/libutil/efun.3 b/lib/libutil/efun.3 index e817b1d8f41f..0bde751a285c 100644 --- a/lib/libutil/efun.3 +++ b/lib/libutil/efun.3 @@ -1,4 +1,4 @@ -.\" $NetBSD: efun.3,v 1.4 2006/10/20 17:40:18 christos Exp $ +.\" $NetBSD: efun.3,v 1.5 2007/07/01 21:41:16 pooka Exp $ .\" .\" Copyright (c) 2006 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -34,7 +34,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 6, 2006 +.Dd July 1, 2007 .Dt EFUN 3 .Os .Sh NAME @@ -45,6 +45,7 @@ .Nm ecalloc , .Nm erealloc , .Nm estrdup , +.Nm estrndup , .Nm estrlcat , .Nm estrlcpy , .Nm evasprintf @@ -67,6 +68,8 @@ .Fn erealloc "void *p" "size_t n" .Ft char * .Fn estrdup "const char *s" +.Ft char * +.Fn estrndup "const char *s" "size_t len" .Ft size_t .Fn estrlcat "char *dst" "const char *src" "size_t len" .Ft size_t @@ -81,6 +84,7 @@ The .Nm emalloc , .Nm erealloc , .Nm estrdup , +.Nm estrndup , .Nm estrlcat , .Nm estrlcpy , and @@ -109,6 +113,7 @@ error handler will just call .Xr malloc 3 , .Xr realloc 3 , .Xr strdup 3 , +.Xr strndup 3 , .Xr strlcat 3 , .Xr strlcpy 3 , .Xr vasprintf 3 diff --git a/lib/libutil/efun.c b/lib/libutil/efun.c index 29bebf67e583..daf5752b1e6a 100644 --- a/lib/libutil/efun.c +++ b/lib/libutil/efun.c @@ -1,4 +1,4 @@ -/* $NetBSD: efun.c,v 1.4 2006/09/27 16:20:03 christos Exp $ */ +/* $NetBSD: efun.c,v 1.5 2007/07/01 21:41:16 pooka Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ #include #ifdef __RCSID -__RCSID("$NetBSD: efun.c,v 1.4 2006/09/27 16:20:03 christos Exp $"); +__RCSID("$NetBSD: efun.c,v 1.5 2007/07/01 21:41:16 pooka Exp $"); #endif #include @@ -98,6 +98,15 @@ estrdup(const char *s) return d; } +char * +estrndup(const char *s, size_t len) +{ + char *d = strndup(s, len); + if (d == NULL) + (*efunc)(1, "Cannot copy string"); + return d; +} + void * emalloc(size_t n) { diff --git a/lib/libutil/shlib_version b/lib/libutil/shlib_version index f5857ae4d3e0..6fbe7dc25bd9 100644 --- a/lib/libutil/shlib_version +++ b/lib/libutil/shlib_version @@ -1,5 +1,5 @@ -# $NetBSD: shlib_version,v 1.43 2007/02/04 08:19:26 elad Exp $ +# $NetBSD: shlib_version,v 1.44 2007/07/01 21:41:16 pooka Exp $ # Remember to update distrib/sets/lists/base/shl.* when changing # major=7 -minor=13 +minor=14