]> git.ipfire.org Git - pakfire.git/commitdiff
pakfire: Use pakfire_string_* functions
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 19 Apr 2021 14:56:28 +0000 (14:56 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 19 Apr 2021 14:56:28 +0000 (14:56 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c

index 1c308f51871350b19fa31afde17c120b821cb9e6..ffa23ee5605bd79ffbba99106ba12382b4226ce2 100644 (file)
@@ -144,7 +144,7 @@ static int __mount(Pakfire pakfire, const char* source, const char* target,
        if (!mp)
                return 1;
 
-       snprintf(mp->path, sizeof(mp->path) - 1, "%s", target);
+       pakfire_string_set(mp->path, target);
        STAILQ_INSERT_HEAD(&pakfire->mountpoints, mp, nodes);
 
        return 0;
@@ -670,10 +670,10 @@ PAKFIRE_EXPORT int pakfire_create(
        }
 
        // Set path
-       snprintf(p->path, sizeof(p->path) - 1, "%s", path);
+       pakfire_string_set(p->path, path);
 
        // Set architecture
-       snprintf(p->arch, sizeof(p->arch) - 1, "%s", arch);
+       pakfire_string_set(p->arch, arch);
 
        // Setup logging
        p->log_function = pakfire_log_syslog;
@@ -715,8 +715,8 @@ PAKFIRE_EXPORT int pakfire_create(
                DEBUG(p, "    slogan     = %s\n", p->distro.slogan);
 
        // Set cache path
-       snprintf(p->cache_path, sizeof(p->cache_path) - 1,
-               "%s/%s/%s", PAKFIRE_CACHE_PATH, p->distro.id, p->distro.version_id);
+       pakfire_string_format(p->cache_path, "%s/%s/%s",
+               PAKFIRE_CACHE_PATH, p->distro.id, p->distro.version_id);
 
        // Mount filesystems
        r = pakfire_mount(p);