[pacman-dev] [PATCH 4/4] Change strcat function using for strncat
Laszlo Papp
djszapi2 at gmail.com
Sun Oct 18 00:04:26 EDT 2009
* Size examined str* function usage is a common coding practice,
because it's more safer to avoid breakage while using str* functions.
Signed-off-by: Laszlo Papp <djszapi at archlinux.us>
---
lib/libalpm/util.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 553591d..41a5783 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -105,7 +105,7 @@ int _alpm_makepath_mode(const char *path, mode_t mode)
/* we have another path component- append the newest component to
* existing string and create one more level of dir structure */
strcat(incr, "/");
- strcat(incr, ptr);
+ strncat(incr, ptr, strlen(ptr));
if(access(incr, F_OK)) {
if(mkdir(incr, mode)) {
ret = 1;
--
1.6.4.4
More information about the pacman-dev
mailing list