From 3c8eb581c34eb64d4974c741091f64f2c64da559 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 31 Aug 2022 12:52:40 +0000 Subject: [PATCH] file: Pass NULL to set function when setting hard/symlinks Signed-off-by: Michael Tremer --- src/libpakfire/file.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/libpakfire/file.c b/src/libpakfire/file.c index 0f9020ba5..2fe7195b7 100644 --- a/src/libpakfire/file.c +++ b/src/libpakfire/file.c @@ -416,10 +416,7 @@ PAKFIRE_EXPORT const char* pakfire_file_get_hardlink(struct pakfire_file* file) } PAKFIRE_EXPORT void pakfire_file_set_hardlink(struct pakfire_file* file, const char* link) { - if (!link || !*link) - *file->hardlink = '\0'; - else - pakfire_string_set(file->hardlink, link); + pakfire_string_set(file->hardlink, link); } PAKFIRE_EXPORT const char* pakfire_file_get_symlink(struct pakfire_file* file) { @@ -430,10 +427,7 @@ PAKFIRE_EXPORT const char* pakfire_file_get_symlink(struct pakfire_file* file) { } PAKFIRE_EXPORT void pakfire_file_set_symlink(struct pakfire_file* file, const char* link) { - if (!link || !*link) - *file->hardlink = '\0'; - else - pakfire_string_set(file->symlink, link); + pakfire_string_set(file->symlink, link); } PAKFIRE_EXPORT int pakfire_file_get_type(struct pakfire_file* file) { -- 2.47.3