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>
This commit is contained in:
parent
81d5a25fbb
commit
d7df383342
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue