diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2006-01-30 10:32:19 +0000 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2006-01-30 10:32:19 +0000 |
commit | 45c1ba772efd16c845f81b0bfb68a842124ba203 (patch) | |
tree | 92f25abf357442bc686616c05b08e115b2af8f9a | |
parent | 17a623cd837dfa63508e3ef49235a522189b6917 (diff) | |
download | quilt-45c1ba772efd16c845f81b0bfb68a842124ba203.tar.gz |
- lib/backup-files.c: Tru64 does not have snprintf. (Reported by
John Vandenberg).
-rw-r--r-- | lib/backup-files.c | 8 | ||||
-rw-r--r-- | quilt.changes | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/backup-files.c b/lib/backup-files.c index a551ac3..d2979d0 100644 --- a/lib/backup-files.c +++ b/lib/backup-files.c @@ -384,22 +384,20 @@ foreachdir_rec(const char *path, struct stat *st, DIR *dir; struct dirent *dp; int failed = 0; - char *p = malloc_nofail(PATH_MAX + 1); + char *p = malloc_nofail(PATH_MAX); if (access(path, R_OK|X_OK) || !(dir = opendir(path))) return walk(path, NULL); while ((dp = readdir(dir))) { - int len; - if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) continue; - len = snprintf(p, PATH_MAX + 1, "%s/%s", path, dp->d_name); - if (len > PATH_MAX || len < 0) { + if (strlen(path) + 1 + strlen(dp->d_name) + 1 > PATH_MAX) { fprintf(stderr, "%s/%s: name too long\n", path, dp->d_name); failed = -1; goto out; } + sprintf(p, "%s/%s", path, dp->d_name); if (lstat(p, st)) continue; /* file has disappeared meanwhile */ diff --git a/quilt.changes b/quilt.changes index 08a21bb..3dd5617 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Jan 30 11:32:29 CET 2006 - agruen@suse.de + +- lib/backup-files.c: Tru64 does not have snprintf. (Reported by + John Vandenberg). + +------------------------------------------------------------------- Mon Jan 30 08:04:17 CET 2006 - khali@linux-fr.org - bash_completion: Update import and mail commands options. |