summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2003-11-30 14:27:42 +0000
committerLennart Poettering <lennart@poettering.net>2003-11-30 14:27:42 +0000
commitb6abf79d60722dbee89e6270435d0b11c0dffa91 (patch)
treed40783bd9c86b989e9f2ddb4a0dc63f9592d74f0 /src/util.c
parentc0d1779760fd10d14344fa1ed70b91bdf50272c1 (diff)
relase 0.3
--copy-always --sort bi-directory merges --check-md git-svn-id: file:///home/lennart/svn/public/syrep/trunk@43 07ea20a6-d2c5-0310-9e02-9ef735347d72
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/util.c b/src/util.c
index ffc5dc3..5361e70 100644
--- a/src/util.c
+++ b/src/util.c
@@ -18,6 +18,10 @@
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
@@ -499,11 +503,11 @@ int prune_empty_directories(const char *path, const char *root) {
char rroot[PATH_MAX],
rpath[PATH_MAX];
- strncpy(rroot, root, PATH_MAX);
+ strncpy(rroot, root, PATH_MAX-1);
rroot[PATH_MAX-1] = 0;
normalize_path(rroot);
- strncpy(rpath, path, PATH_MAX);
+ strncpy(rpath, path, PATH_MAX-1);
rpath[PATH_MAX-1] = 0;
normalize_path(rpath);
@@ -545,7 +549,7 @@ int mkdir_p(const char *path, mode_t m) {
char *e, *b;
int quit = 0;
- strncpy(tmp, path, PATH_MAX);
+ strncpy(tmp, path, PATH_MAX-1);
tmp[PATH_MAX-1] = 0;
normalize_path(tmp);
@@ -582,7 +586,7 @@ int mkdir_p(const char *path, mode_t m) {
int makeprefixpath(const char *path, mode_t m) {
char tmp[PATH_MAX], *e;
- strncpy(tmp, path, PATH_MAX);
+ strncpy(tmp, path, PATH_MAX-1);
tmp[PATH_MAX-1] = 0;
normalize_path(tmp);