--- libaitcfg/src/parse.c 2017/06/28 15:13:03 1.16 +++ libaitcfg/src/parse.c 2017/06/30 08:44:44 1.17 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: parse.c,v 1.16 2017/06/28 15:13:03 misho Exp $ +* $Id: parse.c,v 1.17 2017/06/30 08:44:44 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -56,7 +56,7 @@ SUCH DAMAGE. int cfgReadConfig(FILE *f, cfg_root_t * __restrict cfg) { - char line[BUFSIZ]; + char line[BUFSIZ], origin[BUFSIZ]; struct tagCfg *av = NULL; int flg = 0; char *psAttr, *psVal, szSection[STRSIZ] = { 0 }; @@ -79,6 +79,7 @@ cfgReadConfig(FILE *f, cfg_root_t * __restrict cfg) continue; } else { *psAttr = 0; + strlcpy(origin, line, sizeof origin); str_Trim(line); } @@ -137,7 +138,7 @@ cfgReadConfig(FILE *f, cfg_root_t * __restrict cfg) } /* parse pair */ if (!(psAttr = strchr(line, '='))) { - AIT_SET_STR(&av->cfg_val, line); + AIT_SET_STR(&av->cfg_val, origin); EDEBUG(7, "Ignore a/v '%s' ... not found '='", line); continue; } else {