[BACK]Return to res_init.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / resolv

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libc/resolv/res_init.c between version 1.23 and 1.24

version 1.23, 2011/10/15 23:00:02 version 1.24, 2012/03/13 21:13:43
Line 351  __res_vinit(res_state statp, int preinit
Line 351  __res_vinit(res_state statp, int preinit
             struct kevent kc;              struct kevent kc;
   
             /* read the config file */              /* read the config file */
             while (fgets(buf, sizeof(buf), fp) != NULL) {              while (fgets(buf, (int)sizeof(buf), fp) != NULL) {
                 /* skip comments */                  /* skip comments */
                 if (*buf == ';' || *buf == '#')                  if (*buf == ';' || *buf == '#')
                         continue;                          continue;
Line 598  res_setoptions(res_state statp, const ch
Line 598  res_setoptions(res_state statp, const ch
 {  {
         const char *cp = options;          const char *cp = options;
         int i;          int i;
           size_t j;
         struct __res_state_ext *ext = statp->_u._ext.ext;          struct __res_state_ext *ext = statp->_u._ext.ext;
   
 #ifdef DEBUG  #ifdef DEBUG
Line 690  res_setoptions(res_state statp, const ch
Line 691  res_setoptions(res_state statp, const ch
                         if (ext == NULL)                          if (ext == NULL)
                                 goto skip;                                  goto skip;
                         cp += sizeof("nibble:") - 1;                          cp += sizeof("nibble:") - 1;
                         i = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix) - 1);                          j = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix) - 1);
                         strncpy(ext->nsuffix, cp, (size_t)i);                          strncpy(ext->nsuffix, cp, j);
                         ext->nsuffix[i] = '\0';                          ext->nsuffix[j] = '\0';
                 }                  }
                 else if (!strncmp(cp, "nibble2:", sizeof("nibble2:") - 1)) {                  else if (!strncmp(cp, "nibble2:", sizeof("nibble2:") - 1)) {
                         if (ext == NULL)                          if (ext == NULL)
                                 goto skip;                                  goto skip;
                         cp += sizeof("nibble2:") - 1;                          cp += sizeof("nibble2:") - 1;
                         i = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix2) - 1);                          j = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix2) - 1);
                         strncpy(ext->nsuffix2, cp, (size_t)i);                          strncpy(ext->nsuffix2, cp, j);
                         ext->nsuffix2[i] = '\0';                          ext->nsuffix2[j] = '\0';
                 }                  }
                 else if (!strncmp(cp, "v6revmode:", sizeof("v6revmode:") - 1)) {                  else if (!strncmp(cp, "v6revmode:", sizeof("v6revmode:") - 1)) {
                         cp += sizeof("v6revmode:") - 1;                          cp += sizeof("v6revmode:") - 1;

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

CVSweb <webmaster@jp.NetBSD.org>