Print this page
Code review comments from jeffpc

Split Close
Expand all
Collapse all
          --- old/usr/src/common/secflags/secflags.c
          +++ new/usr/src/common/secflags/secflags.c
↓ open down ↓ 215 lines elided ↑ open up ↑
 216  216                  buf[0] = '\0';
 217  217  
 218  218          if (flags == 0) {
 219  219                  (void) strlcpy(buf, "none", buflen);
 220  220                  return;
 221  221          }
 222  222  
 223  223          for (fd = flagdescs; fd->name != NULL; fd++) {
 224  224                  if (secflag_isset(flags, fd->value)) {
 225  225                          if (buf[0] != '\0')
 226      -                                (void) strlcat(buf, ", ", buflen);
      226 +                                (void) strlcat(buf, ",", buflen);
 227  227                          (void) strlcat(buf, fd->name, buflen);
 228  228                  }
 229  229  
 230  230                  secflag_clear(&flags, fd->value);
 231  231          }
 232  232  
 233  233          if (flags != 0) {       /* unknown flags */
 234      -                char hexbuf[11]; /* 0x%08x */
      234 +                char hexbuf[19]; /* 0x%16 PRIx64 */
 235  235  
 236      -                (void) snprintf(hexbuf, sizeof (hexbuf), "0x%08x", flags);
      236 +                (void) snprintf(hexbuf, sizeof (hexbuf), "0x%16" PRIx64, flags);
 237  237                  if (buf[0] != '\0')
 238      -                        (void) strlcat(buf, ", ", buflen);
      238 +                        (void) strlcat(buf, ",", buflen);
 239  239                  (void) strlcat(buf, hexbuf, buflen);
 240  240          }
 241  241  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX