summaryrefslogtreecommitdiffstats
path: root/firmware/common
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common')
-rw-r--r--firmware/common/file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 75adc8756f..a80aed5396 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -500,6 +500,11 @@ static int readwrite(int fd, void* buf, long count, bool write)
return -1;
}
+ if(file->attr & FAT_ATTR_DIRECTORY) {
+ errno = EISDIR;
+ return -1;
+ }
+
LDEBUGF( "readwrite(%d,%lx,%ld,%s)\n",
fd,(long)buf,count,write?"write":"read");