Shorten "Performance Designed Products" to "PDP"

This commit is contained in:
Sam Lantinga 2019-12-11 17:46:59 -08:00
parent 325a2efb3d
commit e029fdbb38
1 changed files with 8 additions and 1 deletions

View File

@ -616,7 +616,14 @@ HIDAPI_AddDevice(struct hid_device_info *info)
}
}
if (manufacturer_string && product_string) {
size_t name_size = (SDL_strlen(manufacturer_string) + 1 + SDL_strlen(product_string) + 1);
size_t name_size;
if (SDL_strcmp(manufacturer_string, "Performance Designed Products") == 0) {
/* Shorten this so controller names are more manageable */
SDL_memcpy(manufacturer_string, "PDP", 4);
}
name_size = (SDL_strlen(manufacturer_string) + 1 + SDL_strlen(product_string) + 1);
device->name = (char *)SDL_malloc(name_size);
if (device->name) {
if (SDL_strncasecmp(manufacturer_string, product_string, SDL_strlen(manufacturer_string)) == 0) {