MCPcopy Create free account
hub / github.com/clementgallet/libTAS / copyControllerName

Function copyControllerName

src/library/inputs/ioctl_joy.cpp:44–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42namespace libtas {
43
44static int copyControllerName(char* name, int len)
45{
46 static const char controllerName[] = "Microsoft X-Box 360 pad";
47
48 if (name == nullptr || len <= 0)
49 return 0;
50
51 int copyLen = strnlen(controllerName, len - 1);
52 std::memcpy(name, controllerName, copyLen);
53 name[copyLen] = '\0';
54 return copyLen;
55}
56
57DEFINE_ORIG_POINTER(ioctl)
58

Callers 1

ioctlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected