Jelajahi Sumber

macOS: Fix sprintf deprecation warning

Co-authored-by: bruvzg <[email protected]>
(cherry picked from commit a297a69ac88ea595fa935667f0862ad8852f6109)
Rémi Verschelde 2 tahun lalu
induk
melakukan
88381221f2
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  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