mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-11 05:26:24 +02:00
http: Check fread() result to avoid warning.
This will cause the length not to match the result if it happens, but the client should interpret that as a server error. Also a similar error in headless.
This commit is contained in:
1 parent
4a92db4cd6
commit
6592c6222a
2 files changed
+5
-2
No files matched your search
+2
-1
@@ -163,7 +163,8 @@ static void RegisterDiscHandlers(http::Server *http, std::unordered_map<std::str
|
||||
char *buf = new char[CHUNK_SIZE];
|
||||
for (s64 pos = 0; pos < len; pos += CHUNK_SIZE) {
|
||||
s64 chunklen = std::min(len - pos, (s64)CHUNK_SIZE);
|
||||
fread(buf, chunklen, 1, fp);
|
||||
if (fread(buf, chunklen, 1, fp) != 1)
|
||||
break;
|
||||
request.Out()->Push(buf, chunklen);
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
Reference in new issue
Block a user