Skip to content
Snippets Groups Projects
Commit 15d3225e authored by rswindell's avatar rswindell
Browse files

getnodedat() now zeroes node struct before reading or erroring-out.

parent f201235f
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* * * *
* Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright 2003 Rob Swindell - http://www.synchro.net/copyright.html *
* * * *
* This program is free software; you can redistribute it and/or * * This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License * * modify it under the terms of the GNU General Public License *
...@@ -646,9 +646,9 @@ int DLLCALL getnodedat(scfg_t* cfg, uint number, node_t *node, int* fp) ...@@ -646,9 +646,9 @@ int DLLCALL getnodedat(scfg_t* cfg, uint number, node_t *node, int* fp)
|| node==NULL || number<1 || number>cfg->sys_nodes) || node==NULL || number<1 || number>cfg->sys_nodes)
return(-1); return(-1);
memset(node,0,sizeof(node_t));
sprintf(str,"%snode.dab",cfg->ctrl_dir); sprintf(str,"%snode.dab",cfg->ctrl_dir);
if((file=nopen(str,O_RDWR|O_DENYNONE))==-1) { if((file=nopen(str,O_RDWR|O_DENYNONE))==-1) {
memset(node,0,sizeof(node_t));
if(fp!=NULL) if(fp!=NULL)
*fp=file; *fp=file;
return(errno); return(errno);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment