Diff for /libaitcfg/src/parse.c between versions 1.1.1.1.2.2 and 1.1.1.1.2.3

version 1.1.1.1.2.2, 2008/09/30 20:00:26 version 1.1.1.1.2.3, 2008/10/13 17:29:18
Line 101  int ReadConfig(FILE *f, sl_config * __restrict cfg) Line 101  int ReadConfig(FILE *f, sl_config * __restrict cfg)
                                         free(av);                                          free(av);
                                         return -1;                                          return -1;
                                 } else                                  } else
                                        strcpy((char*) av->psSection, (char*) szSection);                                        strlcpy((char*) av->psSection, (char*) szSection, strlen((char*) szSection) + 1);
                         } else                          } else
                                 av->psSection = NULL;                                  av->psSection = NULL;
   
Line 122  int ReadConfig(FILE *f, sl_config * __restrict cfg) Line 122  int ReadConfig(FILE *f, sl_config * __restrict cfg)
                                 free(av);                                  free(av);
                                 return -1;                                  return -1;
                         } else                          } else
                                strcpy((char*) av->psAttribute, (char*) psAttr);                                strlcpy((char*) av->psAttribute, (char*) psAttr, strlen((char*) psAttr) + 1);
                         // added value to element                          // added value to element
                         av->psValue = malloc(strlen((char*) psVal) + 1);                          av->psValue = malloc(strlen((char*) psVal) + 1);
                         if (!av->psValue) {                          if (!av->psValue) {
Line 132  int ReadConfig(FILE *f, sl_config * __restrict cfg) Line 132  int ReadConfig(FILE *f, sl_config * __restrict cfg)
                                 free(av);                                  free(av);
                                 return -1;                                  return -1;
                         } else                          } else
                                strcpy((char*) av->psValue, (char*) psVal);                                strlcpy((char*) av->psValue, (char*) psVal, strlen((char*) psVal) + 1);
                 }                  }
         }          }
   
Line 164  int WriteConfig(FILE *f, sl_config * __restrict cfg) Line 164  int WriteConfig(FILE *f, sl_config * __restrict cfg)
   
         for (av = cfg->slh_first; av; av = av->sle_next) {          for (av = cfg->slh_first; av; av = av->sle_next) {
                 if (av->psSection && strcmp((char*) av->psSection, (char*) szSection)) {                  if (av->psSection && strcmp((char*) av->psSection, (char*) szSection)) {
                        bzero(szSection, MAX_STR + 1);                        strlcpy((char*) szSection, (char*) av->psSection, MAX_STR + 1);
                        strcpy((char*) szSection, (char*) av->psSection); 
                         if (!cfgDbg(f, "\n[%s]\n", av->psSection)) {                          if (!cfgDbg(f, "\n[%s]\n", av->psSection)) {
                                 LOGERR;                                  LOGERR;
                                 return -1;                                  return -1;

Removed from v.1.1.1.1.2.2  
changed lines
  Added in v.1.1.1.1.2.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>