]> git.ipfire.org Git - pakfire.git/commitdiff
Constify a couple of variables
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Mar 2026 17:36:20 +0000 (17:36 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Mar 2026 17:36:20 +0000 (17:36 +0000)
These are all from string matching where the return value will now be
constified if the input argument was.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/arch.c
src/pakfire/cgroup.c
src/pakfire/string.c

index 3ba60c2f36483f4798de84fbe5135634ca464d59..fc534c10d93bb9bf35a44d230f727fb2a7efe3e8 100644 (file)
@@ -159,7 +159,7 @@ int __pakfire_arch_buildtarget(char* buffer, size_t length, const char* arch, co
        int vendor_length = strlen(vendor);
 
        // Cut off suffix if it contains spaces
-       char* space = strchr(vendor, ' ');
+       const char* space = strchr(vendor, ' ');
        if (space)
                vendor_length = space - vendor;
 
index 9137cc38ac3d777a6f7543b883e35a46e38b3cc1..e991fbd82c4336f08650bbfdeca5349c551257a8 100644 (file)
@@ -430,7 +430,7 @@ static int pakfire_cgroup_create_recursive(pakfire_cgroup** cgroup,
                pakfire_ctx* ctx, pakfire_cgroup* parent, const char* name, int flags) {
        pakfire_cgroup* child = NULL;
        char buffer[NAME_MAX];
-       char* p = NULL;
+       const char* p = NULL;
        int r;
 
        // Name cannot be empty
index 0513543df9d7f8efcb78b2a9490eaccafef6782f..7a057fd8b18a68789d2cb147a902d6afec6340f3 100644 (file)
@@ -188,7 +188,7 @@ void pakfire_string_truncate(char* s, const size_t l) {
 }
 
 int pakfire_string_partition(const char* s, const char* delim, char** s1, char** s2) {
-       char* p = strstr(s, delim);
+       const char* p = strstr(s, delim);
 
        // Delim was not found
        if (!p) {