index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2007-10-29 23:32:58 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-10-29 23:32:58 -0500 |
commit | 6aeda5fbff1969befa322ef7b79664f13dea1d18 (patch) | |
tree | 00214dbb296d7e3084ed6cfb060c1db2d9fbe5a0 /src | |
parent | be387148c95ee5ed4e45dc841cd12fee010b998a (diff) |
-rw-r--r-- | src/pacman/callback.c | 3 | ||||
-rw-r--r-- | src/pacman/conf.c | 3 |
diff --git a/src/pacman/callback.c b/src/pacman/callback.c index aec9753a..3061d2a0 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -396,8 +396,9 @@ void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent, oprlen = strlen(opr); wcopr = calloc(oprlen, sizeof(wchar_t)); if(!wcopr) { - fprintf(stderr, "malloc failure: could not allocate %d bytes\n", + fprintf(stderr, "malloc failure: could not allocate %zd bytes\n", strlen(opr) * sizeof(wchar_t)); + return; } oprlen = mbstowcs(wcopr, opr, oprlen); diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 2bc69820..21256d77 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -32,8 +32,9 @@ config_t *config_new(void) { config_t *newconfig = calloc(1, sizeof(config_t)); if(!newconfig) { - fprintf(stderr, "malloc failure: could not allocate %d bytes\n", + fprintf(stderr, "malloc failure: could not allocate %zd bytes\n", sizeof(config_t)); + return(NULL); } /* defaults which may get overridden later */ newconfig->op = PM_OP_MAIN; |