GUI: fix another cppcheck warning

This commit is contained in:
tildearrow 2022-04-14 23:22:11 -05:00
parent be483470ef
commit aa415caa57

View file

@ -1951,14 +1951,13 @@ bool FurnaceGUI::importLayout(String path) {
fclose(f);
return false;
}
unsigned char* file=new unsigned char[len];
if (fseek(f,0,SEEK_SET)<0) {
perror("size error");
lastError=fmt::sprintf("on get size: %s",strerror(errno));
fclose(f);
delete[] file;
return false;
}
unsigned char* file=new unsigned char[len];
if (fread(file,1,(size_t)len,f)!=(size_t)len) {
perror("read error");
lastError=fmt::sprintf("on read: %s",strerror(errno));