Skip to content
Snippets Groups Projects
Commit eecbea50 authored by deuce's avatar deuce
Browse files

<DigitalMan> closing the file before referencing file.error would be bd

<DigitalMan> bad
<DigitalMan> and referencing file.length could very well reset the ferror()
value, so sample and save the file.error value immediately after error
parent 447522b5
Branches
Tags
No related merge requests found
...@@ -160,12 +160,14 @@ for (i in filenames) { ...@@ -160,12 +160,14 @@ for (i in filenames) {
// Doesn't work on Win32.. Win32 sucks. // Doesn't work on Win32.. Win32 sucks.
var fontdata=font.read(font.length); var fontdata=font.read(font.length);
var fonterr=font.error;
font.close();
if(fontdata.length != font.length) { if(fontdata.length != font.length) {
log(LOG_ERR,"!ERROR Error "+font.error+" reading font data (read "+fontdata.length+", expected "+font.length+") errno="+errno); log(LOG_ERR,"!ERROR Error "+fonterr+" reading font data (read "+fontdata.length+", expected "+font.length+") errno="+errno);
font.close();
continue; continue;
} }
font.close();
client.socket.send("\x1b[="+(firstslot+parseInt(i))+";"+fontsize+"{"); client.socket.send("\x1b[="+(firstslot+parseInt(i))+";"+fontsize+"{");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment