summaryrefslogtreecommitdiffstats
path: root/src/types.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2022-05-20 13:15:14 +0300
committergramanas <anastasis.gramm2@gmail.com>2022-05-20 13:15:14 +0300
commitb30cd3e1b8d1162c529bfdd602d0d56ccd2e38c7 (patch)
treebfae4137f78a0bf223518f6590db2bd436e82185 /src/types.c
parent3515199c9e158d4b6fe5d064539bdf288dca7b81 (diff)
downloadfoodtools-b30cd3e1b8d1162c529bfdd602d0d56ccd2e38c7.tar.gz
foodtools-b30cd3e1b8d1162c529bfdd602d0d56ccd2e38c7.tar.bz2
foodtools-b30cd3e1b8d1162c529bfdd602d0d56ccd2e38c7.zip
aha
Diffstat (limited to 'src/types.c')
-rw-r--r--src/types.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/types.c b/src/types.c
index 8918d98..9fbb59b 100644
--- a/src/types.c
+++ b/src/types.c
@@ -279,9 +279,12 @@ void
copy_metadata(recipe * dst, recipe * src)
{
if (!dst || !src) return;
- dst->filename = strdup(src->filename);
- dst->path = strdup(src->path);
- dst->title = strdup(src->title);
+ if (src->filename)
+ dst->filename = strdup(src->filename);
+ if (src->path)
+ dst->path = strdup(src->path);
+ if (src->title)
+ dst->title = strdup(src->title);
}
void