Merge pull request #29 from pmttavara/patch-1

Prevent dangerous bug
This commit is contained in:
gingerBill 2018-02-15 15:16:31 +00:00 committed by GitHub
commit 0378924916
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

9
gb.h
View File

@ -3798,13 +3798,16 @@ gb_inline void *gb_memcopy(void *dest, void const *source, isize n) {
*d++ = *s++; *d++ = *s++; *d++ = *s++; *d++ = *s++;
*d++ = *s++; *d++ = *s++; *d++ = *s++; *d++ = *s++;
}
if (n & 4)
if (n & 4) {
*d++ = *s++; *d++ = *s++; *d++ = *s++; *d++ = *s++;
if (n & 2)
}
if (n & 2) {
*d++ = *s++; *d++ = *s++;
if (n & 1)
}
if (n & 1) {
*d = *s;
}
}
#endif
return dest;