Print this page
libconv

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/prof/common/prof.c
          +++ new/usr/src/cmd/sgs/prof/common/prof.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
       25 + * Copyright 2018 Jason King
  25   26   */
  26   27  
  27   28  /*      Copyright (c) 1988 AT&T */
  28   29  /*        All Rights Reserved   */
  29   30  
  30   31  /*
  31   32   *      Program profiling report generator.
  32   33   *
  33   34   *      Usage:
  34   35   *
↓ open down ↓ 1269 lines elided ↑ open up ↑
1304 1305  
1305 1306  char *format_buf;
1306 1307  #define FORMAT_BUF      "%s\n\t\t\t\t\t    [%s]"
1307 1308  
1308 1309  static char *
1309 1310  demangled_name(char *s)
1310 1311  {
1311 1312          const char *name;
1312 1313          size_t  len;
1313 1314  
1314      -        name = conv_demangle_name(s);
1315      -
1316      -        if (strcmp(name, s) == 0)
     1315 +        if ((name = conv_demangle_name(s)) == s)
1317 1316                  return (s);
1318 1317  
1319 1318          if (format_buf != NULL)
1320 1319                  free(format_buf);
1321 1320  
1322 1321          len = strlen(name) + strlen(FORMAT_BUF) + strlen(s) + 1;
1323 1322          format_buf = malloc(len);
1324 1323          if (format_buf == NULL)
1325 1324                  return (s);
1326 1325          (void) snprintf(format_buf, len, FORMAT_BUF, name, s);
     1326 +        free((void *)name);
1327 1327          return (format_buf);
1328 1328  }
1329 1329  
1330 1330  /* getname - get the name of a symbol in a permanent fashion */
1331 1331  static char *
1332 1332  getname(PROF_FILE *ldpter, PROF_SYMBOL symbol)
1333 1333  {
1334 1334          static char *strtable = NULL;   /* space for names */
1335 1335          static int sp_used = 0;         /* space used so far */
1336 1336          static int size = 0;            /* size of string table */
↓ open down ↓ 35 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX