summaryrefslogtreecommitdiff
path: root/lib/libalpm/md5driver.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-03-06 04:22:03 +0000
committerAaron Griffin <aaron@archlinux.org>2007-03-06 04:22:03 +0000
commit90b75a04351242c5b242359008a51c2fb0dd1d41 (patch)
treeb7ac04003c9d7f45fd6668137e11b26d16a16b74 /lib/libalpm/md5driver.c
parent5baba8439761a54c488ff42e4e599b3c93dbe669 (diff)
downloadpacman-90b75a04351242c5b242359008a51c2fb0dd1d41.tar.xz
* Fix the double package name URL when using XferCommand
* Fixed valgrind yelling about the sprintfs in md5/sha1 routines
Diffstat (limited to 'lib/libalpm/md5driver.c')
-rw-r--r--lib/libalpm/md5driver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libalpm/md5driver.c b/lib/libalpm/md5driver.c
index 60144fee..66071052 100644
--- a/lib/libalpm/md5driver.c
+++ b/lib/libalpm/md5driver.c
@@ -47,6 +47,7 @@ char* _alpm_MDFile(char *filename)
FILE *file;
MD_CTX context;
int len;
+ char hex[3];
unsigned char buffer[1024], digest[16];
ALPM_LOG_FUNC;
@@ -66,10 +67,11 @@ char* _alpm_MDFile(char *filename)
ret = calloc(33, sizeof(char));
for(i = 0; i < 16; i++) {
- sprintf(ret+(i*2), "%02x", digest[i]);
+ snprintf(hex, 3, "%02x", digest[i]);
+ strncat(ret, hex, 2);
}
- _alpm_log(PM_LOG_DEBUG, _("sha1(%s) = %s"), filename, ret);
+ _alpm_log(PM_LOG_DEBUG, _("md5(%s) = %s"), filename, ret);
return(ret);
}
return(NULL);