summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1998-09-09 17:12:58 +0000
committerimp <imp@FreeBSD.org>1998-09-09 17:12:58 +0000
commite38600c29f21a66d9fec0c2abe904624fbf8de66 (patch)
tree7cd0c86f21e29a9f2a886e04c7f5f96e57f90a8c /gnu
parentad467c45567ada6a8d7c3f1d0b2b339941d77589 (diff)
downloadFreeBSD-src-e38600c29f21a66d9fec0c2abe904624fbf8de66.zip
FreeBSD-src-e38600c29f21a66d9fec0c2abe904624fbf8de66.tar.gz
Use size of structure rather than hard coded 256 in readlink. This change
either came from OpenBSD, or was inspired by work done there.
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 9c2c7b5..7a00d7a 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, 256);
+ nb = readlink(dire[j]->d_name, buf, sizeof(dire[j]->d_name) - 1);
if (nb == -1) {
printf("get_dir(): Error reading link: %s\n", dire[j]->d_name);
exit(-1);
OpenPOWER on IntegriCloud