diff options
author | Thomas White <taw@physics.org> | 2020-02-21 17:00:59 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-07-29 18:39:50 +0200 |
commit | 12fa6375acb536e61f41c006fc783e5e8f0c7a92 (patch) | |
tree | 3c81bb26b7ce42ac2e9b113376d106ac0b84c331 /libcrystfel/src/utils.c | |
parent | 7724da7f1ac050838ffce551c9dad52083daf873 (diff) |
Add safe_strdup() to utils
Diffstat (limited to 'libcrystfel/src/utils.c')
-rw-r--r-- | libcrystfel/src/utils.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |