Browse Source

Use crc16 return value when calculating GUID

Fixes the regression introduced by 919cd56b20c59249bdde3bb005aeeb8f6550f3e3

(cherry picked from commit a2e05480d63cac530269c846422e7de3b44e830f)
Lukas Senionis 1 year ago
parent
commit
e7c4575719
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/joystick/SDL_joystick.c

+ 4 - 4
src/joystick/SDL_joystick.c

@@ -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. */