summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-08-18 08:32:45 +0200
committerAngel Pons <th3fanbus@gmail.com>2021-08-19 10:02:05 +0000
commitd7df383342ee8f36783e1c8bf70c9a65225dd168 (patch)
treecf017a8f11b6bf1c1dbd48f836d33cb9c8293c99
parent81d5a25fbb32924490c018efb9461f0d8d747cf9 (diff)
device_util.c: Replace `memcpy()` with `strcpy()`
Use `strcpy()` instead of `memcpy()` to copy string literals. Change-Id: I8ebf591e3348d992739ed7cc2e4015aa650f115a Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/57013 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
-rw-r--r--src/device/device_util.c6
1 files 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, "<null>", 7);
+ strcpy(buffer, "<null>");
} 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),