Began working on a few bugs, thanks /u/skeeto!

This commit is contained in:
2023-01-15 20:30:17 +00:00
parent aeecfabbbc
commit 68ed39fc45
5 changed files with 22 additions and 6 deletions

View File

@@ -180,19 +180,22 @@ static unsigned char readByte(unsigned char* tb, int* count) {
}
static unsigned short readShort(unsigned char* tb, int* count) {
unsigned short ret = *(unsigned short*)(tb + *count);
unsigned short ret = 0;
memcpy(&ret, tb + *count, 2);
*count += 2;
return ret;
}
static int readInt(unsigned char* tb, int* count) {
int ret = *(int*)(tb + *count);
int ret = 0;
memcpy(&ret, tb + *count, 4);
*count += 4;
return ret;
}
static float readFloat(unsigned char* tb, int* count) {
float ret = *(float*)(tb + *count);
float ret = 0;
memcpy(&ret, tb + *count, 4);
*count += 4;
return ret;
}