From 97313ba31645796148c3f413d9ebde365df06dbe Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 25 Apr 2007 17:24:23 -0400 Subject: More pacman side cleanup * Cleaned up more of the header #includes, and got rid of a lot of stuff that was due to trying to make it compile on BSD/Darwin/CYGWIN. We can add it later but lets keep it simple for now and do it in seperate files if possible later. * Removed a lot of #define MACROS. Some were not even used, and others were only used a few times. Signed-off-by: Dan McGee --- src/pacman/util.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/pacman/util.c') diff --git a/src/pacman/util.c b/src/pacman/util.c index 1fb6ead9..a7259e25 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -21,10 +21,6 @@ #include "config.h" -#if defined(__APPLE__) || defined(__OpenBSD__) -#include -#include -#endif #include #include #include @@ -37,9 +33,6 @@ #include #include #include -#ifdef CYGWIN -#include /* PATH_MAX */ -#endif #include #include @@ -88,7 +81,7 @@ int getcols() int makepath(char *path) { char *orig, *str, *ptr; - char full[PATH_MAX] = ""; + char full[PATH_MAX+1] = ""; mode_t oldmask; oldmask = umask(0000); @@ -99,6 +92,7 @@ int makepath(char *path) if(strlen(ptr)) { struct stat buf; + /* TODO we should use strncat */ strcat(full, "/"); strcat(full, ptr); if(stat(full, &buf)) { -- cgit v1.2.3