Use crc16 return value when calculating GUID

Fixes the regression introduced by 919cd56b20

(cherry picked from commit a2e05480d63cac530269c846422e7de3b44e830f)
This commit is contained in:
Lukas Senionis 2023-12-21 15:11:32 +02:00 committed by Sam Lantinga
parent 39a0013900
commit e7c4575719

View file

@ -2458,11 +2458,11 @@ SDL_JoystickGUID SDL_CreateJoystickGUID(Uint16 bus, Uint16 vendor, Uint16 produc
SDL_zero(guid);
if (vendor_name && *vendor_name && product_name && *product_name) {
SDL_crc16(crc, vendor_name, SDL_strlen(vendor_name));
SDL_crc16(crc, " ", 1);
SDL_crc16(crc, product_name, SDL_strlen(product_name));
crc = SDL_crc16(crc, vendor_name, SDL_strlen(vendor_name));
crc = SDL_crc16(crc, " ", 1);
crc = SDL_crc16(crc, product_name, SDL_strlen(product_name));
} else if (product_name) {
SDL_crc16(crc, product_name, SDL_strlen(product_name));
crc = SDL_crc16(crc, product_name, SDL_strlen(product_name));
}
/* We only need 16 bits for each of these; space them out to fill 128. */