]> git.ipfire.org Git - people/ric9/pakfire.git/commitdiff
parser: Refactor stripping namespaces
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 14:19:56 +0000 (14:19 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 14:19:56 +0000 (14:19 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/parser.c

index 5244de47513d502629586d150506f9228c964e4b..90302d7685e3821a5fbc1d4265896befbd3fa258 100644 (file)
@@ -231,9 +231,9 @@ static void pakfire_parser_strip_namespace(char** s) {
        char* pos = strrchr(*s, '.');
 
        if (pos)
-               (*s)[pos - *s] = '\0';
+               *pos = '\0';
        else
-               (*s)[0] = '\0';
+               *s = '\0';
 }
 
 static char* pakfire_parser_join(const char* c, const char* val1, const char* val2) {