Skip to content
Snippets Groups Projects
Commit 690bb56e authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

A file descriptor of 0 is technically valid (though normally, STDIN)

Likely fix for CID 514647
parent e0b84113
Branches
Tags
No related merge requests found
Pipeline #7133 passed
......@@ -257,7 +257,7 @@ int openuserdat(scfg_t* cfg, bool for_modify)
int closeuserdat(int file)
{
if(file < 1)
if(file < 0)
return -1;
return close(file);
}
......@@ -1393,7 +1393,7 @@ char* getnodeext(scfg_t* cfg, int num, char* buf)
if(!VALID_CFG(cfg) || num < 1)
return "";
if((f = opennodeext(cfg)) < 1)
if((f = opennodeext(cfg)) < 0)
return "";
(void)lseek(f, (num-1) * 128, SEEK_SET);
if(read(f, buf, 128) != 128)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment