summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorhobbs <hobbs>2003-02-19 01:05:27 (GMT)
committerhobbs <hobbs>2003-02-19 01:05:27 (GMT)
commit8f0f9765065901d39650a0f204dda8f4687155f5 (patch)
treeb744ff10b50ebd18053e9a82b43f00beef074bcf /unix
parent8b1b828ae2abf9c2992239a94a7eaec9475b0ec0 (diff)
downloadtcl-8f0f9765065901d39650a0f204dda8f4687155f5.zip
tcl-8f0f9765065901d39650a0f204dda8f4687155f5.tar.gz
tcl-8f0f9765065901d39650a0f204dda8f4687155f5.tar.bz2
* unix/tclUnixThrd.c (TclpReaddir): reduce size of name string in
tsd to NAME_MAX instead of PATH_MAX. [Bug #689100] (waters)
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixThrd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index 1dd2d99..28267f4 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -25,7 +25,9 @@ typedef struct ThreadSpecificData {
struct tm ltbuf;
struct {
Tcl_DirEntry ent;
- char name[PATH_MAX+1];
+#ifdef NAME_MAX /* if not, dirent *better* have room for name */
+ char name[NAME_MAX+1];
+#endif
} rdbuf;
} ThreadSpecificData;
@@ -819,7 +821,7 @@ TclpReaddir(DIR * dir)
# endif /* HAVE_STRUCT_DIRENT64 */
if (ent != NULL) {
memcpy((VOID *) &tsdPtr->rdbuf.ent, (VOID *) ent,
- sizeof(Tcl_DirEntry) + sizeof(char) * (PATH_MAX+1));
+ sizeof(&tsdPtr->rdbuf));
ent = &tsdPtr->rdbuf.ent;
}
Tcl_MutexUnlock(&rdMutex);