From: Michael Tremer Date: Tue, 20 Apr 2021 12:29:20 +0000 (+0000) Subject: file: Use pakfire_string_* functions X-Git-Tag: 0.9.28~1285^2~301 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7917fb3e3a8523df4b04da93872a94534ae77da;p=pakfire.git file: Use pakfire_string_* functions Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/file.c b/src/libpakfire/file.c index ed6bd5d63..0a76530f4 100644 --- a/src/libpakfire/file.c +++ b/src/libpakfire/file.c @@ -161,7 +161,7 @@ const char* pakfire_file_get_abspath(PakfireFile file) { } int pakfire_file_set_abspath(PakfireFile file, const char* path) { - return snprintf(file->abspath, sizeof(file->abspath) - 1, "%s", path); + return pakfire_string_set(file->abspath, path); } PAKFIRE_EXPORT const char* pakfire_file_get_path(PakfireFile file) { @@ -169,7 +169,7 @@ PAKFIRE_EXPORT const char* pakfire_file_get_path(PakfireFile file) { } PAKFIRE_EXPORT int pakfire_file_set_path(PakfireFile file, const char* path) { - return snprintf(file->path, sizeof(file->path) - 1, "%s", path); + return pakfire_string_set(file->path, path); } PAKFIRE_EXPORT int pakfire_file_get_type(PakfireFile file) { @@ -189,7 +189,7 @@ PAKFIRE_EXPORT const char* pakfire_file_get_user(PakfireFile file) { } PAKFIRE_EXPORT void pakfire_file_set_user(PakfireFile file, const char* user) { - snprintf(file->user, sizeof(file->user) - 1, "%s", user); + pakfire_string_set(file->user, user); } PAKFIRE_EXPORT const char* pakfire_file_get_group(PakfireFile file) { @@ -197,7 +197,7 @@ PAKFIRE_EXPORT const char* pakfire_file_get_group(PakfireFile file) { } PAKFIRE_EXPORT void pakfire_file_set_group(PakfireFile file, const char* group) { - snprintf(file->group, sizeof(file->group) - 1, "%s", group); + pakfire_string_set(file->group, group); } PAKFIRE_EXPORT mode_t pakfire_file_get_mode(PakfireFile file) {