Changeset 62 for pjproject/trunk/pjlib/src/pj/string.c
- Timestamp:
- Nov 20, 2005 7:55:42 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/string.c
r51 r62 28 28 29 29 30 static char hex[] = {'0', '1', '2', '3', '4', '5', '6', '7',31 '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };32 33 30 PJ_DEF(pj_str_t*) pj_strltrim( pj_str_t *str ) 34 31 { … … 51 48 } 52 49 53 PJ_INLINE(void) pj_val_to_hex_digit(unsigned value, char *p)54 {55 *p++ = hex[ (value & 0xF0) >> 4 ];56 *p++ = hex[ (value & 0x0F) ];57 }58 59 50 PJ_DEF(char*) pj_create_random_string(char *str, pj_size_t len) 60 51 { … … 73 64 } 74 65 for (i=i * 8; i<len; ++i) { 75 *p++ = hex[ pj_rand() & 0x0F ];66 *p++ = pj_hex_digits[ pj_rand() & 0x0F ]; 76 67 } 77 68 return str; … … 130 121 } 131 122 123
Note: See TracChangeset
for help on using the changeset viewer.