src/joystick/hidapi/SDL_hidapijoystick.c
changeset 13332 71116618f317
parent 13330 c88765bcf1da
child 13333 88aec26a0ad0
equal deleted inserted replaced
13331:a523954cd529 13332:71116618f317
   614                 manufacturer_string = SDL_iconv_string("UTF-8", "UCS-4-INTERNAL", (char*)info->manufacturer_string, (SDL_wcslen(info->manufacturer_string)+1)*sizeof(wchar_t));
   614                 manufacturer_string = SDL_iconv_string("UTF-8", "UCS-4-INTERNAL", (char*)info->manufacturer_string, (SDL_wcslen(info->manufacturer_string)+1)*sizeof(wchar_t));
   615                 product_string = SDL_iconv_string("UTF-8", "UCS-4-INTERNAL", (char*)info->product_string, (SDL_wcslen(info->product_string)+1)*sizeof(wchar_t));
   615                 product_string = SDL_iconv_string("UTF-8", "UCS-4-INTERNAL", (char*)info->product_string, (SDL_wcslen(info->product_string)+1)*sizeof(wchar_t));
   616             }
   616             }
   617         }
   617         }
   618         if (manufacturer_string && product_string) {
   618         if (manufacturer_string && product_string) {
   619             size_t name_size = (SDL_strlen(manufacturer_string) + 1 + SDL_strlen(product_string) + 1);
   619             size_t name_size;
       
   620 
       
   621             if (SDL_strcmp(manufacturer_string, "Performance Designed Products") == 0) {
       
   622                 /* Shorten this so controller names are more manageable */
       
   623                 SDL_memcpy(manufacturer_string, "PDP", 4);
       
   624             }
       
   625 
       
   626             name_size = (SDL_strlen(manufacturer_string) + 1 + SDL_strlen(product_string) + 1);
   620             device->name = (char *)SDL_malloc(name_size);
   627             device->name = (char *)SDL_malloc(name_size);
   621             if (device->name) {
   628             if (device->name) {
   622                 if (SDL_strncasecmp(manufacturer_string, product_string, SDL_strlen(manufacturer_string)) == 0) {
   629                 if (SDL_strncasecmp(manufacturer_string, product_string, SDL_strlen(manufacturer_string)) == 0) {
   623                     SDL_strlcpy(device->name, product_string, name_size);
   630                     SDL_strlcpy(device->name, product_string, name_size);
   624                 } else {
   631                 } else {