--- libaitcfg/src/parse.c 2012/08/06 14:53:34 1.10 +++ libaitcfg/src/parse.c 2012/08/06 15:08:26 1.10.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: parse.c,v 1.10 2012/08/06 14:53:34 misho Exp $ +* $Id: parse.c,v 1.10.2.1 2012/08/06 15:08:26 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -231,17 +231,15 @@ cfgWriteConfig(FILE *f, cfg_root_t * __restrict cfg, i /* build line */ memset(line, 0, sizeof line); - if (!AIT_ISEMPTY(&av->cfg_attr) && AIT_TYPE(&av->cfg_attr) == string && - AIT_ADDR(&av->cfg_attr)) { - strlcpy(line, AIT_GET_STR(&av->cfg_attr), sizeof line); + if (!AIT_ISEMPTY(&av->cfg_attr) && AIT_TYPE(&av->cfg_attr) == string) { + strlcpy(line, AIT_GET_STRZ(&av->cfg_attr), sizeof line); if (whitespace) strlcat(line, " = ", sizeof line); else strlcat(line, "=", sizeof line); } - if (!AIT_ISEMPTY(&av->cfg_val) && AIT_TYPE(&av->cfg_val) == string && - AIT_ADDR(&av->cfg_val)) - strlcat(line, AIT_GET_STR(&av->cfg_val), sizeof line); + if (!AIT_ISEMPTY(&av->cfg_val) && AIT_TYPE(&av->cfg_val) == string) + strlcat(line, AIT_GET_STRZ(&av->cfg_val), sizeof line); /* write */ if (!cfg_Write(f, "%s\n", line)) {