Changeset 4910


Ignore:
Timestamp:
Sep 1, 2014 6:32:50 AM (10 years ago)
Author:
riza
Message:

Misc (re #1751): fixed printing value issue when using %02X format. (Thanks Itay Bianco for the report).

Location:
pjproject/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util-test/encryption.c

    r4537 r4910  
    5454    for (i = 0; i < PJ_SHA1_DIGEST_SIZE/4; i++) { 
    5555        for (j = 0; j < 4; j++) { 
    56             sprintf(c,"%02X", digest[i*4+j]); 
     56            sprintf(c,"%02X", digest[i*4+j] & 0xFF); 
    5757            c += 2; 
    5858        } 
  • pjproject/trunk/pjlib/src/pj/ssl_sock_dump.c

    r3553 r4910  
    6464    for (i = 0; i < sizeof(ci->serial_no) && !ci->serial_no[i]; ++i); 
    6565    for (; i < sizeof(ci->serial_no); ++i) { 
    66         len = pj_ansi_snprintf(p, end-p, "%02X ", ci->serial_no[i]); 
     66        len = pj_ansi_snprintf(p, end-p, "%02X ", ci->serial_no[i] & 0xFF); 
    6767        CHECK_BUF_LEN(); 
    6868    } 
  • pjproject/trunk/pjnath/src/pjnath-test/stun.c

    r4537 r4910  
    926926        puts(""); 
    927927        printf("{ "); 
    928         for (i=0; i<len; ++i) printf("0x%02x, ", packet[i]); 
     928        for (i=0; i<len; ++i) printf("0x%02x, ", packet[i] & 0xFF); 
    929929        puts(" }"); 
    930930    } 
Note: See TracChangeset for help on using the changeset viewer.