samstyle / Xpeccy

Multiplatform emulator of retro computers
MIT License
73 stars 14 forks source link

The 2nd memset() argument '512' doesn't fit into an 'unsigned char'. #99

Closed ZanyXDev closed 3 years ago

ZanyXDev commented 3 years ago

https://github.com/samstyle/Xpeccy/blob/0c7c288ead6d94c197f0ccbf57e68b64b5744f75/src/libxpeccy/sdcard.c#L90

The second parameter, int 512, is the character to fill s with. Note that while this parameter is received as an int, it is converted to an unsigned char when used to fill memory, to ensure that the function keeps just the eight bits needed from the received integer. May be write memset((void*)&sdc->buf.data[1],0xff,512); ??