From 86b136bb592bf576a3da950fee153f6d4f5b9d15 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Thu, 18 Jan 2007 16:52:57 +0000 Subject: Dan McGee * 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 --- lib/libalpm/be_files.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/libalpm/be_files.c') 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" -- cgit v1.2.3-24-g4f1b