Browse Source

[core] buffer_append_uint_hex_lc() uses lc hex

personal/stbuehler/fix-fdevent
Glenn Strauss 4 years ago
parent
commit
3d880810d1
  1. 4
      src/buffer.c
  2. 3
      src/buffer.h

4
src/buffer.c

@ -236,7 +236,7 @@ void buffer_append_string_buffer(buffer *b, const buffer *src) {
}
}
void buffer_append_uint_hex(buffer *b, uintmax_t value) {
void buffer_append_uint_hex_lc(buffer *b, uintmax_t value) {
char *buf;
unsigned int shift = 0;
@ -253,7 +253,7 @@ void buffer_append_uint_hex(buffer *b, uintmax_t value) {
while (shift > 0) {
shift -= 4;
*(buf++) = hex_chars[(value >> shift) & 0x0F];
*(buf++) = hex_chars_lc[(value >> shift) & 0x0F];
}
}

3
src/buffer.h

@ -73,7 +73,8 @@ void buffer_append_string(buffer *b, const char *s);
void buffer_append_string_len(buffer *b, const char *s, size_t s_len);
void buffer_append_string_buffer(buffer *b, const buffer *src);
void buffer_append_uint_hex(buffer *b, uintmax_t len);
#define buffer_append_uint_hex(b,len) buffer_append_uint_hex_lc((b),(len))
void buffer_append_uint_hex_lc(buffer *b, uintmax_t len);
void buffer_append_int(buffer *b, intmax_t val);
void buffer_copy_int(buffer *b, intmax_t val);

Loading…
Cancel
Save