Avoid relying on writable string literals in macros
This hack here is illegal in c++. Just strdup() the silly little string, it's not like this is a performance critical spot.
This commit is contained in:
parent
401d845d99
commit
3a2b04c96d
|
@ -1353,7 +1353,8 @@ static void doFoo(rpmMacroBuf mb, rpmMacroEntry me, ARGV_t argv, size_t *parsed)
|
|||
} else if (rstreq("getconfdir", me->name)) {
|
||||
b = (char *)rpmConfigDir();
|
||||
} else if (rstreq("exists", me->name)) {
|
||||
b = (access(argv[1], F_OK) == 0) ? "1" : "0";
|
||||
buf = xstrdup((access(argv[1], F_OK) == 0) ? "1" : "0");
|
||||
b = buf;
|
||||
}
|
||||
|
||||
if (b) {
|
||||
|
|
Loading…
Reference in New Issue