From 6063424c82f18f3ea8bbf9a92fd30b349ec778bd Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Tue, 29 Mar 2005 17:18:59 +0000 Subject: Replaced snprintf calls by the SNPRINTF macro to avoid buffer overflows when copying strings --- lib/libalpm/alpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/alpm.c') diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index b7987e9d..da879569 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -74,7 +74,7 @@ int alpm_initialize(char *root) } } - strncpy(str, (root) ? root : PM_ROOT, PATH_MAX); + STRNCPY(str, (root) ? root : PM_ROOT, PATH_MAX); /* add a trailing '/' if there isn't one */ if(str[strlen(str)-1] != '/') { strcat(str, "/"); -- cgit v1.2.3