From: Michael Tremer Date: Wed, 31 Aug 2022 12:52:40 +0000 (+0000) Subject: file: Pass NULL to set function when setting hard/symlinks X-Git-Tag: 0.9.28~353 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c8eb581c34eb64d4974c741091f64f2c64da559;p=pakfire.git file: Pass NULL to set function when setting hard/symlinks Signed-off-by: Michael Tremer --- 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) {