summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/util.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-04-08 21:55:30 -0500
committerDan McGee <dan@archlinux.org>2012-04-08 21:55:30 -0500
commitd158dde30c378acc8e88d5208aa837f92331af9e (patch)
treeb99456c7b765becdb5bab3869af5a2e512026562 /lib/libalpm/util.c
parent31091963edaa505d00642aecb9950ce087a40b73 (diff)
parentb729ed01093312cef7ce48d07b13e225b25446db (diff)
downloadpacman-d158dde30c378acc8e88d5208aa837f92331af9e.tar.xz
Merge remote-tracking branch 'dave/buildsys'
Oh god, what are we thinking thinking merging this. Hopefully this works with only a few follow-up patches necessary.
Diffstat (limited to 'lib/libalpm/util.c')
-rw-r--r--lib/libalpm/util.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 22e9e359..a392c773 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -621,7 +621,9 @@ int _alpm_ldconfig(alpm_handle_t *handle)
if(access(line, F_OK) == 0) {
snprintf(line, PATH_MAX, "%ssbin/ldconfig", handle->root);
if(access(line, X_OK) == 0) {
- char *argv[] = { "ldconfig", NULL };
+ char arg0[32];
+ char *argv[] = { arg0, NULL };
+ strcpy(arg0, "ldconfig");
return _alpm_run_chroot(handle, "/sbin/ldconfig", argv);
}
}
@@ -676,7 +678,8 @@ const char *_alpm_filecache_setup(alpm_handle_t *handle)
{
struct stat buf;
alpm_list_t *i;
- char *cachedir, *tmpdir;
+ char *cachedir;
+ const char *tmpdir;
/* Loop through the cache dirs until we find a usable directory */
for(i = handle->cachedirs; i; i = i->next) {
@@ -995,13 +998,13 @@ int _alpm_archive_fgets(struct archive *a, struct archive_read_buffer *b)
}
if(needed > b->line_size) {
/* need to realloc + copy data to fit total length */
- char *new;
- CALLOC(new, needed, sizeof(char), b->ret = -ENOMEM; goto cleanup);
- memcpy(new, b->line, b->line_size);
+ char *new_line;
+ CALLOC(new_line, needed, sizeof(char), b->ret = -ENOMEM; goto cleanup);
+ memcpy(new_line, b->line, b->line_size);
b->line_size = needed;
- b->line_offset = new + (b->line_offset - b->line);
+ b->line_offset = new_line + (b->line_offset - b->line);
free(b->line);
- b->line = new;
+ b->line = new_line;
}
}