From de6abbfddf1b0e15f444f4fe2a642d3a9775eec7 Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Mon, 21 Aug 2017 23:40:07 +0100 Subject: Small bug fixed --- netbytes.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'netbytes.c') diff --git a/netbytes.c b/netbytes.c index 8831b33..07c1301 100644 --- a/netbytes.c +++ b/netbytes.c @@ -519,7 +519,7 @@ int nb_load( netbyte_store *store, uint8_t *data ) __NBT_SIZE size; memcpy( &size, c, sizeof(__NBT_SIZE) ); - printf("size: %d\n", size); + printf("NB_LOAD size: %d\n", size); size -= sizeof(__NBT_SIZE); c += sizeof(__NBT_SIZE); @@ -600,12 +600,14 @@ int nb_load( netbyte_store *store, uint8_t *data ) } case NBT_U32: { - nb_u32 *u32 = malloc( sizeof(nb_u32) ); - - memcpy( u32, c, sizeof(nb_u32) ); + //FIXIT in all places + //nb_u32 *u32 = malloc( sizeof(nb_u32) ); + nb_u32 u32; + + memcpy( &u32, c, sizeof(nb_u32) ); c += sizeof(nb_u32); - nb_add_u32( store, u32 ); + nb_add_u32( store, &u32 ); break; } case NBT_U32ARRAY: -- cgit v1.2.3