aboutsummaryrefslogtreecommitdiff
path: root/src/spm.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2020-03-07 01:45:07 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2020-03-07 01:45:07 -0500
commit2a9eaa0aa4a046bb2dfd4c2aeb1ebbdcff0770b9 (patch)
tree374904f82f827222746c8a4ca40664eba6641d7f /src/spm.c
parente6d43d723b75ffc489f436238459175eab49d895 (diff)
downloadspmc-2a9eaa0aa4a046bb2dfd4c2aeb1ebbdcff0770b9.tar.gz
Refactor RPATH creation:
* Decreased complexity * Most rpath_* functions accept a FSTree structure now * Fewer calls to chdir() overall * Deeply nested libraries are detected * Libraries are no longer confined to lib/ and /lib64
Diffstat (limited to 'src/spm.c')
-rw-r--r--src/spm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/spm.c b/src/spm.c
index 7f153a8..f398f0e 100644
--- a/src/spm.c
+++ b/src/spm.c
@@ -29,9 +29,7 @@ void usage(const char *program_name) {
}
int main(int argc, char *argv[], char *arge[]) {
- char program_name[strlen(argv[0]) + 1];
- memset(program_name, '\0', sizeof(program_name) + 1);
- strcpy(program_name, basename(argv[0]));
+ char *program_name = strdup(basename(argv[0]));
// not much to see here yet
// at the moment this will all be random tests, for better or worse
@@ -320,5 +318,6 @@ int main(int argc, char *argv[], char *arge[]) {
strlist_free(packages);
manifestlist_free(mf);
spm_hierarchy_free(rootfs);
+ free(program_name);
return 0;
}