Fixed endianness bug in sml_number_init - revised

This commit is contained in:
dapaulid 2012-08-07 16:35:27 +02:00
parent bff3552911
commit 52a967db1f

View file

@ -34,7 +34,7 @@ void *sml_number_init(u64 number, unsigned char type, int size) {
// Swap bytes of big-endian number so that
// memcpy copies the right part
if (sml_number_endian() == SML_BIG_ENDIAN) {
sml_number_byte_swap(bytes, sizeof(u64));
bytes += sizeof(u64) - size;
}
unsigned char *np = malloc(size);