From 302310c5aad5ae25a1e712ca6f9de6bef73e17de Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 11 Oct 2009 14:19:55 -0500 Subject: Minor scope/typing cleanups Signed-off-by: Dan McGee --- src/pacman/pacman.c | 4 ++-- src/pacman/util.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index ac515029..5e824f4d 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -612,7 +612,7 @@ static char *get_filename(const char *url) { static char *get_destfile(const char *path, const char *filename) { char *destfile; /* len = localpath len + filename len + null */ - int len = strlen(path) + strlen(filename) + 1; + size_t len = strlen(path) + strlen(filename) + 1; destfile = calloc(len, sizeof(char)); snprintf(destfile, len, "%s%s", path, filename); @@ -622,7 +622,7 @@ static char *get_destfile(const char *path, const char *filename) { static char *get_tempfile(const char *path, const char *filename) { char *tempfile; /* len = localpath len + filename len + '.part' len + null */ - int len = strlen(path) + strlen(filename) + 6; + size_t len = strlen(path) + strlen(filename) + 6; tempfile = calloc(len, sizeof(char)); snprintf(tempfile, len, "%s%s.part", path, filename); diff --git a/src/pacman/util.c b/src/pacman/util.c index 353aae3a..0351556e 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -453,13 +453,13 @@ void string_display(const char *title, const char *string) int len = 0; if(title) { - /* compute the length of title + a space */ - len = string_length(title) + 1; printf("%s ", title); } if(string == NULL || string[0] == '\0') { printf(_("None")); } else { + /* compute the length of title + a space */ + len = string_length(title) + 1; indentprint(string, len); } printf("\n"); -- cgit v1.2.3-70-g09d2