gowin: set file descriptor to NULL to avoid segfault when no file a provided

This commit is contained in:
Gwenhael Goavec-Merou 2020-01-12 16:29:29 +01:00
parent db0bc008b1
commit f7f13ad3a7
1 changed files with 1 additions and 0 deletions

View File

@ -66,6 +66,7 @@ using namespace std;
Gowin::Gowin(FtdiJtag *jtag, const string filename, bool flash_wr, bool sram_wr,
bool verbose): Device(jtag, filename, verbose)
{
_fs = NULL;
if (_filename != "") {
if (_file_extension == "fs") {
if (flash_wr && sram_wr)