Print this page
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libc/port/threads/assfail.c
          +++ new/usr/src/lib/libc/port/threads/assfail.c
↓ open down ↓ 444 lines elided ↑ open up ↑
 445  445  {
 446  446          __assfail(assertion, filename, line_num);
 447  447  }
 448  448  
 449  449  void
 450  450  assfail3(const char *assertion, uintmax_t lv, const char *op, uintmax_t rv,
 451  451      const char *filename, int line_num)
 452  452  {
 453  453          char buf[1000];
 454  454          (void) strcpy(buf, assertion);
 455      -        (void) strcat(buf, " (0x");
      455 +        (void) strcat(buf, " (");
 456  456          ultos((uint64_t)lv, 16, buf + strlen(buf));
 457  457          (void) strcat(buf, " ");
 458  458          (void) strcat(buf, op);
 459      -        (void) strcat(buf, " 0x");
      459 +        (void) strcat(buf, " ");
 460  460          ultos((uint64_t)rv, 16, buf + strlen(buf));
 461  461          (void) strcat(buf, ")");
 462  462          __assfail(buf, filename, line_num);
 463  463  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX