Use -EISDIR instead of -2 in GetFileLength for directories.

This commit is contained in:
Reece H. Dunn
2017-02-04 16:02:56 +00:00
parent d89c6fdcc3
commit df6a2228b7
5 changed files with 19 additions and 10 deletions
+2
View File
@@ -78,6 +78,8 @@ static espeak_ng_STATUS ReadPhFile(void **ptr, const char *fname, int *size, esp
sprintf(buf, "%s%c%s", path_home, PATHSEP, fname);
length = GetFileLength(buf);
if (length < 0) // length == -errno
return create_file_error_context(context, -length, buf);
if ((f_in = fopen(buf, "rb")) == NULL)
return create_file_error_context(context, errno, buf);