From 12fa6375acb536e61f41c006fc783e5e8f0c7a92 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 21 Feb 2020 17:00:59 +0100 Subject: Add safe_strdup() to utils --- libcrystfel/src/utils.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libcrystfel/src/utils.c') diff --git a/libcrystfel/src/utils.c b/libcrystfel/src/utils.c index de1dc2f4..0c01c069 100644 --- a/libcrystfel/src/utils.c +++ b/libcrystfel/src/utils.c @@ -503,6 +503,13 @@ char *check_prefix(char *prefix) } +char *safe_strdup(const char *in) +{ + if ( in == NULL ) return NULL; + return strdup(in); +} + + char *safe_basename(const char *in) { int i; -- cgit v1.2.3