Use sizeof() instead of magic number

This commit is contained in:
Christian Semmler 2023-10-26 06:11:43 -04:00
parent 24c9f8b9ed
commit 4c387d6d49
No known key found for this signature in database
GPG key ID: 086DAA1360BEEE5C

View file

@ -240,8 +240,8 @@ void Score::Paint()
AmbulanceMissionState* lebp = (AmbulanceMissionState*) GameState()->GetState("AmbulanceMissionState");
DDSURFACEDESC desc;
memset(&desc, 0, 0x6c);
desc.dwSize = 0x6c;
memset(&desc, 0, sizeof(desc));
desc.dwSize = sizeof(desc);
if (gd->m_surface->Lock(NULL, &desc, 0, NULL) == DD_OK) {
if (desc.lPitch != desc.dwWidth) {
gd->m_surface->Unlock(desc.lpSurface);