mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-05-28 23:24:11 +02:00
Replaced uint32_t with size_t.
User buffer size is not limited by msgpack-c so size_t is the appropriate type.
This commit is contained in:
parent
aa790ba785
commit
b9bc9d4195
@ -99,7 +99,7 @@ MSGPACK_DLLEXPORT
|
||||
void msgpack_object_print(FILE* out, msgpack_object o);
|
||||
|
||||
MSGPACK_DLLEXPORT
|
||||
int msgpack_object_print_buffer(char *buffer, uint32_t buffer_size, msgpack_object o);
|
||||
int msgpack_object_print_buffer(char *buffer, size_t buffer_size, msgpack_object o);
|
||||
|
||||
MSGPACK_DLLEXPORT
|
||||
bool msgpack_object_equal(const msgpack_object x, const msgpack_object y);
|
||||
|
@ -222,10 +222,10 @@ void msgpack_object_print(FILE* out, msgpack_object o)
|
||||
}
|
||||
}
|
||||
|
||||
int msgpack_object_print_buffer(char *buffer, uint32_t buffer_size, msgpack_object o)
|
||||
int msgpack_object_print_buffer(char *buffer, size_t buffer_size, msgpack_object o)
|
||||
{
|
||||
char *aux_buffer = buffer;
|
||||
uint32_t aux_buffer_size = buffer_size;
|
||||
size_t aux_buffer_size = buffer_size;
|
||||
int ret;
|
||||
switch(o.type) {
|
||||
case MSGPACK_OBJECT_NIL:
|
||||
@ -309,7 +309,7 @@ int msgpack_object_print_buffer(char *buffer, uint32_t buffer_size, msgpack_obje
|
||||
} else {
|
||||
memcpy(aux_buffer, o.via.bin.ptr, aux_buffer_size);
|
||||
aux_buffer_size = 0;
|
||||
}
|
||||
}
|
||||
ret = snprintf(aux_buffer, aux_buffer_size, "\"");
|
||||
aux_buffer = aux_buffer + ret;
|
||||
aux_buffer_size = aux_buffer_size - ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user