|
|
| version 1.30, 2003/04/15 14:30:14 | version 1.31, 2003/04/25 11:56:36 |
|---|---|
| Line 287 static const char* hex_string(Pool& pool | Line 287 static const char* hex_string(Pool& pool |
| unsigned char *src=bytes; | unsigned char *src=bytes; |
| unsigned char *end=bytes+size; | unsigned char *end=bytes+size; |
| char *dest=bytes_hex; | char *dest=bytes_hex; |
| static const char *hex=upcase?"0123456789ABCDEF":"0123456789abcdef"; | |
| const char *format=upcase?"%02X":"%02x"; | const char *format=upcase?"%02X":"%02x"; |
| while(src<end) | for(; src<end; src++) { |
| dest+=snprintf(dest, 3, format, *src++); | *dest++=hex[*src/0x10]; |
| *dest++=hex[*src%0x10]; | |
| } | |
| *dest=0; | |
| return bytes_hex; | return bytes_hex; |
| } | } |