diff options
author | Russ Cox <rsc@swtch.com> | 2020-05-18 17:03:42 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2020-05-18 17:04:36 -0400 |
commit | c53ad837a734f7570badcb3666ccb3604e7e6467 (patch) | |
tree | 7afa8131e9d31dc307adcce9dddced7c34135a5b | |
parent | 587933c16132d880a06ff99bd087e64a3a04975e (diff) | |
download | plan9port-c53ad837a734f7570badcb3666ccb3604e7e6467.tar.gz plan9port-c53ad837a734f7570badcb3666ccb3604e7e6467.tar.bz2 plan9port-c53ad837a734f7570badcb3666ccb3604e7e6467.zip |
lib9: avoid unportable use of d_namlen in dirread
Fixes #395.
-rw-r--r-- | src/lib9/open.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib9/open.c b/src/lib9/open.c index 65ea99ec..2354268b 100644 --- a/src/lib9/open.c +++ b/src/lib9/open.c @@ -318,8 +318,7 @@ dirreadmax(int fd, Dir **dp, int max) return -1; break; } - if(de->d_name[de->d_namlen] != 0) - sysfatal("bad readdir"); + // Note: not all systems have d_namlen. Assume NUL-terminated. if(de->d_name[0]=='.' && de->d_name[1]==0) continue; if(de->d_name[0]=='.' && de->d_name[1]=='.' && de->d_name[2]==0) |