Print this page
5910 libnisdb won't build with modern GCC

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libnisdb/ldap_attr.c
          +++ new/usr/src/lib/libnisdb/ldap_attr.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   *
  14   14   * When distributing Covered Code, include this CDDL HEADER in each
  15   15   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16   16   * If applicable, add the following below this CDDL HEADER, with the
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
       23 + * Copyright 2015 Gary Mills
  23   24   * Copyright 2001-2003 Sun Microsystems, Inc.  All rights reserved.
  24   25   * Use is subject to license terms.
  25   26   */
  26   27  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  28      -
  29   28  #include <sys/systeminfo.h>
  30   29  #include <strings.h>
  31   30  #include <rpcsvc/nis.h>
  32   31  
  33   32  #include "nis_parse_ldap_conf.h"
  34   33  
  35   34  #include "ldap_attr.h"
  36   35  #include "ldap_util.h"
  37   36  #include "ldap_structs.h"
  38   37  
↓ open down ↓ 169 lines elided ↑ open up ↑
 208  207          str = sdup(myself, T, attr);
 209  208          if (str == 0)
 210  209                  return (0);
 211  210          filter = sdup(myself, T, "(&");
 212  211          if (filter == 0) {
 213  212                  free(str);
 214  213                  return (0);
 215  214          }
 216  215          for (s = c = 0; s < len; s = e+1) {
 217  216                  /* Skip blank space, if any */
 218      -                for (0; str[s] == ' ' || str[s] == '\t'; s++);
      217 +                for (; str[s] == ' ' || str[s] == '\t'; s++);
 219  218                  /* Find delimiter (comma) or end of string */
 220  219                  for (e = s; str[e] != '\0' && str[e] != ','; e++);
 221  220                  str[e] = '\0';
 222  221                  tmp = scat(myself, T, sdup(myself, T, "("),
 223  222                          scat(myself, F, &str[s], ")"));
 224  223                  if (tmp == 0) {
 225  224                          sfree(filter);
 226  225                          return (0);
 227  226                  }
 228  227                  c++;
↓ open down ↓ 49 lines elided ↑ open up ↑
 278  277          }
 279  278  
 280  279          if (filter != 0 && (len = strlen(filter)) != 0 && len > 2 &&
 281  280                          filter[0] == '(' && filter[1] == '&' &&
 282  281                          filter[len-1] == ')') {
 283  282                  str = sdup(myself, T, filter);
 284  283                  if (str == 0)
 285  284                          return (0);
 286  285                  for (s = 2; s < len; s = e+1) {
 287  286                          /* Skip past the '(' */
 288      -                        for (0; s < len && str[s] != '('; s++);
      287 +                        for (; s < len && str[s] != '('; s++);
 289  288                          s++;
 290  289                          if (s >= len)
 291  290                                  break;
 292  291                          for (e = s; str[e] != '\0' && str[e] != ')'; e++);
 293  292                          str[e] = '\0';
 294  293                          new = realloc(comp, (nc+1) * sizeof (comp[nc]));
 295  294                          if (new == 0) {
 296  295                                  if (comp != 0) {
 297  296                                          for (i = 0; i < nc; i++)
 298  297                                                  sfree(comp[i]);
↓ open down ↓ 144 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX