diff options
author | pfg <pfg@FreeBSD.org> | 2012-07-15 21:20:31 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2012-07-15 21:20:31 +0000 |
commit | c0067691830e39c9b829d3e5d06f2333df2ce417 (patch) | |
tree | 4bd79e71c71a2832bc02b80ecb5b2eba3f162c2f /cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c | |
parent | 75e8bdba0bf7c646dffc8befe132948a78497092 (diff) | |
download | FreeBSD-src-c0067691830e39c9b829d3e5d06f2333df2ce417.zip FreeBSD-src-c0067691830e39c9b829d3e5d06f2333df2ce417.tar.gz |
Use libc's strndup() instead of Dtrace's reimplementation.
Corresponds partially to OpenSolaris change:
PSARC 2010/299 GNU/Linux/BSD compatibility functions
6901783 strndup would be nice
MFC after: 2 weeks
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c index 3a5315e..782d66c 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_string.c @@ -29,23 +29,6 @@ #include <ctype.h> #include <dt_string.h> -#include <dt_impl.h> - -/* - * Create a copy of string s, but only duplicate the first n bytes. - */ -char * -strndup(const char *s, size_t n) -{ - char *s2 = malloc(n + 1); - - if (s2 == NULL) - longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); - - (void) strncpy(s2, s, n); - s2[n] = '\0'; - return (s2); -} /* * Transform string s inline, converting each embedded C escape sequence string |