tree-wide: do not use "re" with fmemopen

The man page says nothing about "e". Glibc clearly accepts it without fuss, but
it is meaningless for a memory object (and probably doesn't work). This use is
not portable, so let's avoid it.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-10-19 10:10:57 +02:00
parent dc1768131a
commit f3bd4b3df5
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ static inline FILE* data_to_file(const uint8_t *data, size_t size) {
if (size == 0)
return fopen("/dev/null", "re");
else
return fmemopen_unlocked((char*) data, size, "re");
return fmemopen_unlocked((char*) data, size, "r");
}
/* Check if we are within the specified size range.