index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | David Macek <david.macek.0@gmail.com> | 2015-11-29 14:55:15 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2015-12-06 00:22:40 +1000 |
commit | 71f9de64c6eaf11e22551de56d4e9233dddfe238 (patch) | |
tree | 8d0080328b097f2dfd244c5f9d0cde2b2e03c6c1 /lib | |
parent | 8ee084dbb33a9a9fee77376f5fac07f331a24ef8 (diff) |
-rw-r--r-- | lib/libalpm/alpm.c | 7 |
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 0798c0bc..54dfade2 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -65,8 +65,11 @@ alpm_handle_t SYMEXPORT *alpm_initialize(const char *root, const char *dbpath, goto cleanup; } - MALLOC(hookdir, strlen(myhandle->root) + strlen(SYSHOOKDIR) + 1, goto cleanup); - sprintf(hookdir, "%s%s", myhandle->root, SYSHOOKDIR); + /* to contatenate myhandle->root (ends with a slash) with SYSHOOKDIR (starts + * with a slash) correctly, we skip SYSHOOKDIR[0]; the regular +1 therefore + * disappears from the allocation */ + MALLOC(hookdir, strlen(myhandle->root) + strlen(SYSHOOKDIR), goto cleanup); + sprintf(hookdir, "%s%s", myhandle->root, SYSHOOKDIR + 1); myhandle->hookdirs = alpm_list_add(NULL, hookdir); /* set default database extension */ |