summaryrefslogtreecommitdiff
path: root/lib/libalpm/be_files.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-01-18 16:52:57 +0000
committerAaron Griffin <aaron@archlinux.org>2007-01-18 16:52:57 +0000
commit86b136bb592bf576a3da950fee153f6d4f5b9d15 (patch)
treef6289e427de5c5b2cfd3e3d37b75fc9506eb3bdb /lib/libalpm/be_files.c
parent46e26ac5c8d15fbb2385ad972f2f69891a0bd8d0 (diff)
downloadpacman-86b136bb592bf576a3da950fee153f6d4f5b9d15.tar.xz
Dan McGee <dpmcgee@gmail.com>
* Removed some unnecessary headers and library links * Made things static if possible * Cleaned up makefiles a bit * Fixed some old comments in the code * Fixed some errors the static code checker splint pointed out * Backwards arguments in a memset call in _alpm_db_read (could have been worse) * Other various small fixes Other: * Default to 80 columns when getcols cannot determine display width * Removal of ._install as a valid install file in packages
Diffstat (limited to 'lib/libalpm/be_files.c')
-rw-r--r--lib/libalpm/be_files.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c
index 62d08dd3..e722f626 100644
--- a/lib/libalpm/be_files.c
+++ b/lib/libalpm/be_files.c
@@ -180,7 +180,7 @@ int _alpm_db_read(pmdb_t *db, unsigned int inforeq, pmpkg_t *info)
FILE *fp = NULL;
struct stat buf;
char path[PATH_MAX+1];
- char line[513] = {0};
+ char line[513];
pmlist_t *tmplist;
char *locale;
@@ -205,7 +205,7 @@ int _alpm_db_read(pmdb_t *db, unsigned int inforeq, pmpkg_t *info)
_alpm_log(PM_LOG_FUNCTION, _("loading package data for %s : level=%d"), info->name, inforeq);
/* clear out 'line', to be certain - and to make valgrind happy */
- memset(line, 513, 0);
+ memset(line, 0, 513);
snprintf(path, PATH_MAX, "%s/%s-%s", db->path, info->name, info->version);
if(stat(path, &buf)) {
@@ -528,20 +528,20 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, unsigned int inforeq)
}
if(info->size) {
fprintf(fp, "%%SIZE%%\n"
- "%ld\n\n", info->size);
+ "%lu\n\n", info->size);
}
if(info->reason) {
fprintf(fp, "%%REASON%%\n"
- "%d\n\n", info->reason);
+ "%u\n\n", info->reason);
}
} else {
if(info->size) {
fprintf(fp, "%%CSIZE%%\n"
- "%ld\n\n", info->size);
+ "%lu\n\n", info->size);
}
if(info->isize) {
fprintf(fp, "%%ISIZE%%\n"
- "%ld\n\n", info->isize);
+ "%lu\n\n", info->isize);
}
if(info->sha1sum) {
fprintf(fp, "%%SHA1SUM%%\n"