summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1998-09-10 16:14:29 +0000
committerimp <imp@FreeBSD.org>1998-09-10 16:14:29 +0000
commit4da8db7501887d799efbf5cec963030001bee96a (patch)
treee915dd18613f5b6390c41dc0f2de8ea605211281 /gnu
parent5a22ba75e086c88f248a02b9bf642123a2e401b2 (diff)
downloadFreeBSD-src-4da8db7501887d799efbf5cec963030001bee96a.zip
FreeBSD-src-4da8db7501887d799efbf5cec963030001bee96a.tar.gz
Fix bogus length restriction on readlink. Use sizeof(buf) - 1 rather
than the size of the directory name. Fix style bug which increased the number of lines > 80 characters by one. Pointed out by: bde
Diffstat (limited to 'gnu')
-rw-r--r--gnu/lib/libdialog/dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gnu/lib/libdialog/dir.c b/gnu/lib/libdialog/dir.c
index 7a00d7a..5348c2f 100644
--- a/gnu/lib/libdialog/dir.c
+++ b/gnu/lib/libdialog/dir.c
@@ -457,7 +457,7 @@ get_dir(char *dirname, char *fmask, DirList **dir, int *n)
if ((S_IFMT & status.st_mode) == S_IFLNK) { /* handle links */
(*dir)[i].link = TRUE;
stat(dire[j]->d_name, &status);
- nb = readlink(dire[j]->d_name, buf, sizeof(dire[j]->d_name) - 1);
+ nb = readlink(dire[j]->d_name, buf, sizeof(buf) - 1);
if (nb == -1) {
printf("get_dir(): Error reading link: %s\n", dire[j]->d_name);
exit(-1);
OpenPOWER on IntegriCloud