From: Karel Zak Date: Thu, 25 Apr 2013 09:05:33 +0000 (+0200) Subject: mount: (deprecated) remove duplicate xstrndup() X-Git-Tag: v2.23~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b154410cb17b45e33b8349d2e56b32d96a0b3585;p=thirdparty%2Futil-linux.git mount: (deprecated) remove duplicate xstrndup() Signed-off-by: Karel Zak --- diff --git a/mount-deprecated/sundries.c b/mount-deprecated/sundries.c index 8ef3618e55..3710439672 100644 --- a/mount-deprecated/sundries.c +++ b/mount-deprecated/sundries.c @@ -22,20 +22,6 @@ int verbose; int nocanonicalize; char *progname; -char * -xstrndup (const char *s, int n) { - char *t; - - if (s == NULL) - die (EX_SOFTWARE, _("bug in xstrndup call")); - - t = xmalloc(n+1); - strncpy(t,s,n); - t[n] = 0; - - return t; -} - /* reallocates its first arg - typical use: s = xstrconcat3(s,t,u); */ char * xstrconcat3 (char *s, const char *t, const char *u) { diff --git a/mount-deprecated/sundries.h b/mount-deprecated/sundries.h index e58fa49756..428d4a2092 100644 --- a/mount-deprecated/sundries.h +++ b/mount-deprecated/sundries.h @@ -34,7 +34,6 @@ void die(int err, const char *fmt, ...) int matching_type (const char *type, const char *types); int matching_opts (const char *options, const char *test_opts); -char *xstrndup (const char *s, int n); char *xstrconcat3 (char *, const char *, const char *); char *xstrconcat4 (char *, const char *, const char *, const char *);