summaryrefslogtreecommitdiff
path: root/drivers/core/dump.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-08-02 12:12:01 -0600
committerSimon Glass <sjg@chromium.org>2017-09-11 21:43:58 -0600
commita0f9acb08bd6f3b4a6f3adcb02c8170e522c074a (patch)
tree47a72daa778482d4fea2129c2cc99fd45249b874 /drivers/core/dump.c
parent226b50bbd87b0c4ebf913066dfadbe04306ce402 (diff)
downloadu-boot-a0f9acb08bd6f3b4a6f3adcb02c8170e522c074a.tar.gz
dm: core: Drop use of strlcpy()
We can use printf() to limit the string width. Adjust the code to do this instead of using strlcpy() which is a bit clumbsy. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/core/dump.c')
-rw-r--r--drivers/core/dump.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/core/dump.c b/drivers/core/dump.c
index c3e109e7ed..1bb64098f4 100644
--- a/drivers/core/dump.c
+++ b/drivers/core/dump.c
@@ -14,11 +14,9 @@ static void show_devices(struct udevice *dev, int depth, int last_flag)
{
int i, is_last;
struct udevice *child;
- char class_name[12];
/* print the first 11 characters to not break the tree-format. */
- strlcpy(class_name, dev->uclass->uc_drv->name, sizeof(class_name));
- printf(" %-11s [ %c ] ", class_name,
+ printf(" %-10.10s [ %c ] ", dev->uclass->uc_drv->name,
dev->flags & DM_FLAG_ACTIVATED ? '+' : ' ');
for (i = depth; i >= 0; i--) {
@@ -50,7 +48,7 @@ void dm_dump_all(void)
root = dm_root();
if (root) {
- printf(" Class Probed Name\n");
+ printf(" Class Probed Name\n");
printf("----------------------------------------\n");
show_devices(root, -1, 0);
}