Explorar o código

Merge pull request #71722 from akien-mga/3.x-macos-sprintf

macOS: Fix sprintf deprecation warning
Rémi Verschelde %!s(int64=2) %!d(string=hai) anos
pai
achega
8b9b488a62
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      platform/osx/joypad_osx.cpp

+ 1 - 1
platform/osx/joypad_osx.cpp

@@ -323,7 +323,7 @@ bool JoypadOSX::configure_joypad(IOHIDDeviceRef p_device_ref, joypad *p_joy) {
 
 	if (vendor && product_id) {
 		char uid[128];
-		sprintf(uid, "%08x%08x%08x%08x", OSSwapHostToBigInt32(3), OSSwapHostToBigInt32(vendor), OSSwapHostToBigInt32(product_id), OSSwapHostToBigInt32(version));
+		snprintf(uid, 128, "%08x%08x%08x%08x", OSSwapHostToBigInt32(3), OSSwapHostToBigInt32(vendor), OSSwapHostToBigInt32(product_id), OSSwapHostToBigInt32(version));
 		input->joy_connection_changed(id, true, name, uid);
 	} else {
 		//bluetooth device