summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch/util.h
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2014-12-25 21:51:28 +0000
committerpfg <pfg@FreeBSD.org>2014-12-25 21:51:28 +0000
commitf9a4136de0ddd1d48a33e089a7ee67f09fedebb4 (patch)
treee9f394a602a19bbe3aefd3701b9f5e9631df6b19 /usr.bin/patch/util.h
parenta5140616afea75587f25d7fc244b3a894d028b26 (diff)
downloadFreeBSD-src-f9a4136de0ddd1d48a33e089a7ee67f09fedebb4.zip
FreeBSD-src-f9a4136de0ddd1d48a33e089a7ee67f09fedebb4.tar.gz
patch: Bring in xstrdup and use it when appropriate.
The function savestr allows NULL return values during Plan A patching so in case of out of memory conditions, Plan B can step in. In many cases, NULL value is not properly handled, so use xstrdup here (it's outside Plan A/B patching, which means that even Plan B relies on successful operations). Clean up some whitespaces while here Obtained from: OpenBSD MFC after: 2 weeks
Diffstat (limited to 'usr.bin/patch/util.h')
-rw-r--r--usr.bin/patch/util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/patch/util.h b/usr.bin/patch/util.h
index 5759d68..ff2feab 100644
--- a/usr.bin/patch/util.h
+++ b/usr.bin/patch/util.h
@@ -23,7 +23,7 @@
* -C option added in 1998, original code by Marc Espie, based on FreeBSD
* behaviour
*
- * $OpenBSD: util.h,v 1.15 2005/06/20 07:14:06 otto Exp $
+ * $OpenBSD: util.h,v 1.16 2014/12/13 10:31:07 tobias Exp $
* $FreeBSD$
*/
@@ -41,6 +41,7 @@ void pfatal(const char *, ...)
void ask(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
char *savestr(const char *);
+char *xstrdup(const char *);
void set_signals(int);
void ignore_signals(void);
void makedirs(const char *, bool);
OpenPOWER on IntegriCloud