Strip whitespace from Evdev and OSX controller names.

This commit is contained in:
Scott Mansell
2016-07-01 15:05:24 +12:00
parent f59b8b7536
commit e0839a9478
3 changed files with 10 additions and 6 deletions

View File

@ -6,6 +6,8 @@
#include <Foundation/Foundation.h>
#include <IOKit/hid/IOHIDLib.h>
#include "Common/StringUtil.h"
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "InputCommon/ControllerInterface/OSX/OSX.h"
#include "InputCommon/ControllerInterface/OSX/OSXJoystick.h"
@ -137,7 +139,7 @@ static void DeviceMatching_callback(void* inContext, IOReturn inResult, void* in
IOHIDDeviceRef inIOHIDDeviceRef)
{
NSString* pName = (NSString*)IOHIDDeviceGetProperty(inIOHIDDeviceRef, CFSTR(kIOHIDProductKey));
std::string name = (pName != nullptr) ? [pName UTF8String] : "Unknown device";
std::string name = (pName != nullptr) ? StripSpaces([pName UTF8String]) : "Unknown device";
DeviceDebugPrint(inIOHIDDeviceRef);