mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-05-30 07:52:41 +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);
|
void msgpack_object_print(FILE* out, msgpack_object o);
|
||||||
|
|
||||||
MSGPACK_DLLEXPORT
|
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
|
MSGPACK_DLLEXPORT
|
||||||
bool msgpack_object_equal(const msgpack_object x, const msgpack_object y);
|
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;
|
char *aux_buffer = buffer;
|
||||||
uint32_t aux_buffer_size = buffer_size;
|
size_t aux_buffer_size = buffer_size;
|
||||||
int ret;
|
int ret;
|
||||||
switch(o.type) {
|
switch(o.type) {
|
||||||
case MSGPACK_OBJECT_NIL:
|
case MSGPACK_OBJECT_NIL:
|
||||||
@ -309,7 +309,7 @@ int msgpack_object_print_buffer(char *buffer, uint32_t buffer_size, msgpack_obje
|
|||||||
} else {
|
} else {
|
||||||
memcpy(aux_buffer, o.via.bin.ptr, aux_buffer_size);
|
memcpy(aux_buffer, o.via.bin.ptr, aux_buffer_size);
|
||||||
aux_buffer_size = 0;
|
aux_buffer_size = 0;
|
||||||
}
|
}
|
||||||
ret = snprintf(aux_buffer, aux_buffer_size, "\"");
|
ret = snprintf(aux_buffer, aux_buffer_size, "\"");
|
||||||
aux_buffer = aux_buffer + ret;
|
aux_buffer = aux_buffer + ret;
|
||||||
aux_buffer_size = aux_buffer_size - ret;
|
aux_buffer_size = aux_buffer_size - ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user