Skip to content

Commit

Permalink
Fix uninitialized warnings causing build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
bdrewery committed Jan 13, 2013
1 parent d4283a3 commit 69e0e11
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions libpkg/backup.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ copy_database(sqlite3 *src, sqlite3 *dst, const char *name)
b = sqlite3_backup_init(dst, "main", src, "main");

elapsed = -1;
done = total = 0;
start = time(NULL);

do {
Expand Down
4 changes: 2 additions & 2 deletions libpkg/fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ pkg_fetch_file_to_fd(const char *url, int dest, time_t t)
bool srv = false;
bool http = false;
char zone[MAXHOSTNAMELEN + 13];
struct dns_srvinfo *srv_current;
struct http_mirror *http_current;
struct dns_srvinfo *srv_current = NULL;
struct http_mirror *http_current = NULL;
const char *mt;

fetchTimeout = 30;
Expand Down
4 changes: 2 additions & 2 deletions libpkg/pkg_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ analyse_elf(struct pkg *pkg, const char *fpath,
struct stat sb;
int ret = EPKG_OK;

size_t numdyn;
size_t sh_link;
size_t numdyn = 0;
size_t sh_link = 0;
size_t dynidx;
const char *osname;
const char *shlib;
Expand Down
2 changes: 1 addition & 1 deletion libpkg/pkg_repo.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ static int
maybe_delete_conflicting(const char *origin, const char *version,
const char *pkg_path)
{
int ret;
int ret = EPKG_FATAL;
const char *oversion;

if (run_prepared_statement(VERSION, origin) != SQLITE_ROW)
Expand Down
2 changes: 1 addition & 1 deletion pkg/create.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pkg_create_matches(int argc, char **argv, match_t match, pkg_formats fmt,
struct pkg_head head = STAILQ_HEAD_INITIALIZER(head);
struct pkg_entry *e = NULL;
char pkgpath[MAXPATHLEN];
const char *format;
const char *format = NULL;
bool foundone;

#ifndef PKG_COMPAT
Expand Down
2 changes: 1 addition & 1 deletion pkg/update.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pkgcli_update(bool force) {
const char *repo_name;
bool multi_repos = false;
struct pkg_config_kv *repokv = NULL;
int retcode;
int retcode = EPKG_FATAL;

if (!quiet)
printf("Updating repository catalogue\n");
Expand Down

0 comments on commit 69e0e11

Please sign in to comment.