radv: replace memset()+strcpy() with snprintf()
authorEric Engestrom <eric.engestrom@intel.com>
Mon, 8 Jul 2019 16:14:28 +0000 (17:14 +0100)
committerEric Engestrom <eric.engestrom@intel.com>
Sun, 21 Jul 2019 09:38:17 +0000 (10:38 +0100)
Just like the next line :)

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c

index af7fcb6fcff200af4e6212a124dc0ed512d6efbb..a4ec2e4ac1604c4297d6c8b6b47e10b5a20cca57 100644 (file)
@@ -1340,9 +1340,7 @@ void radv_GetPhysicalDeviceProperties2(
                                (VkPhysicalDeviceDriverPropertiesKHR *) ext;
 
                        driver_props->driverID = VK_DRIVER_ID_MESA_RADV_KHR;
-                       memset(driver_props->driverName, 0, VK_MAX_DRIVER_NAME_SIZE_KHR);
-                       strcpy(driver_props->driverName, "radv");
-
+                       snprintf(driver_props->driverName, VK_MAX_DRIVER_NAME_SIZE_KHR, "radv");
                        snprintf(driver_props->driverInfo, VK_MAX_DRIVER_INFO_SIZE_KHR,
                                "Mesa " PACKAGE_VERSION MESA_GIT_SHA1
                                " (LLVM " MESA_LLVM_VERSION_STRING ")");