From d7df383342ee8f36783e1c8bf70c9a65225dd168 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Wed, 18 Aug 2021 08:32:45 +0200 Subject: [PATCH] device_util.c: Replace `memcpy()` with `strcpy()` Use `strcpy()` instead of `memcpy()` to copy string literals. Change-Id: I8ebf591e3348d992739ed7cc2e4015aa650f115a Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/57013 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Felix Held --- src/device/device_util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/device/device_util.c b/src/device/device_util.c index 9e71287342..7b72a94811 100644 --- a/src/device/device_util.c +++ b/src/device/device_util.c @@ -152,14 +152,14 @@ const char *dev_path(const struct device *dev) buffer[0] = '\0'; if (!dev) { - memcpy(buffer, "", 7); + strcpy(buffer, ""); } else { switch (dev->path.type) { case DEVICE_PATH_NONE: - memcpy(buffer, "NONE", 5); + strcpy(buffer, "NONE"); break; case DEVICE_PATH_ROOT: - memcpy(buffer, "Root Device", 12); + strcpy(buffer, "Root Device"); break; case DEVICE_PATH_PCI: snprintf(buffer, sizeof(buffer),