Fix node.compile fwrite size check.

The return value from fwrite was being checked against the size of the data rather than the number of bytes written.
This caused node.compile() to falsely return failure.
This commit is contained in:
h2zero 2022-05-23 10:07:49 -06:00 committed by Johny Mattsson
parent e8caaebc5a
commit c75ec760aa
1 changed files with 1 additions and 1 deletions

View File

@ -603,7 +603,7 @@ static int writer(lua_State* L, const void* p, size_t size, void* u)
if (!file)
return 1;
if (size != 0 && (size != fwrite((const char *)p, size, 1, file)) )
if (size != 0 && (fwrite((const char *)p, size, 1, file) != 1) )
return 1;
return 0;