summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwdfk-prog <[email protected]>2022-12-21 16:09:53 +0800
committerMan, Jianting (Meco) <[email protected]>2022-12-22 22:51:24 -0500
commitf4c08cfe36f886939a8cee53877c5cd8201cafe2 (patch)
treea440bcc022ec8b0cb8c3c9d38ca19e19f3069bce
parentdb6ee55379aae1a4b2cad5b7cab4d5891334db79 (diff)
修改printf格式“%-*.s”为“%-*.*s
-rw-r--r--components/finsh/cmd.c22
-rw-r--r--components/utilities/ulog/ulog.c2
2 files changed, 12 insertions, 12 deletions
diff --git a/components/finsh/cmd.c b/components/finsh/cmd.c
index 2ba98a1a22..57b033cc57 100644
--- a/components/finsh/cmd.c
+++ b/components/finsh/cmd.c
@@ -166,11 +166,11 @@ long list_thread(void)
maxlen = RT_NAME_MAX;
#ifdef RT_USING_SMP
- rt_kprintf("%-*.s cpu bind pri status sp stack size max used left tick error\n", maxlen, item_title);
+ rt_kprintf("%-*.*s cpu bind pri status sp stack size max used left tick error\n", maxlen, maxlen, item_title);
object_split(maxlen);
rt_kprintf(" --- ---- --- ------- ---------- ---------- ------ ---------- ---\n");
#else
- rt_kprintf("%-*.s pri status sp stack size max used left tick error\n", maxlen, item_title);
+ rt_kprintf("%-*.*s pri status sp stack size max used left tick error\n", maxlen, maxlen, item_title);
object_split(maxlen);
rt_kprintf(" --- ------- ---------- ---------- ------ ---------- ---\n");
#endif /*RT_USING_SMP*/
@@ -278,7 +278,7 @@ long list_sem(void)
maxlen = RT_NAME_MAX;
- rt_kprintf("%-*.s v suspend thread\n", maxlen, item_title);
+ rt_kprintf("%-*.*s v suspend thread\n", maxlen, maxlen, item_title);
object_split(maxlen);
rt_kprintf(" --- --------------\n");
@@ -344,7 +344,7 @@ long list_event(void)
maxlen = RT_NAME_MAX;
- rt_kprintf("%-*.s set suspend thread\n", maxlen, item_title);
+ rt_kprintf("%-*.*s set suspend thread\n", maxlen, maxlen, item_title);
object_split(maxlen);
rt_kprintf(" ---------- --------------\n");
@@ -408,7 +408,7 @@ long list_mutex(void)
maxlen = RT_NAME_MAX;
- rt_kprintf("%-*.s owner hold priority suspend thread \n", maxlen, item_title);
+ rt_kprintf("%-*.*s owner hold priority suspend thread \n", maxlen, maxlen, item_title);
object_split(maxlen);
rt_kprintf(" -------- ---- -------- --------------\n");
@@ -481,7 +481,7 @@ long list_mailbox(void)
maxlen = RT_NAME_MAX;
- rt_kprintf("%-*.s entry size suspend thread\n", maxlen, item_title);
+ rt_kprintf("%-*.*s entry size suspend thread\n", maxlen, maxlen, item_title);
object_split(maxlen);
rt_kprintf(" ---- ---- --------------\n");
@@ -551,7 +551,7 @@ long list_msgqueue(void)
maxlen = RT_NAME_MAX;
- rt_kprintf("%-*.s entry suspend thread\n", maxlen, item_title);
+ rt_kprintf("%-*.*s entry suspend thread\n", maxlen, maxlen, item_title);
object_split(maxlen);
rt_kprintf(" ---- --------------\n");
do
@@ -617,7 +617,7 @@ long list_memheap(void)
maxlen = RT_NAME_MAX;
- rt_kprintf("%-*.s pool size max used size available size\n", maxlen, item_title);
+ rt_kprintf("%-*.*s pool size max used size available size\n", maxlen, maxlen, item_title);
object_split(maxlen);
rt_kprintf(" ---------- ------------- --------------\n");
do
@@ -673,7 +673,7 @@ long list_mempool(void)
maxlen = RT_NAME_MAX;
- rt_kprintf("%-*.s block total free suspend thread\n", maxlen, item_title);
+ rt_kprintf("%-*.*s block total free suspend thread\n", maxlen, maxlen, item_title);
object_split(maxlen);
rt_kprintf(" ---- ---- ---- --------------\n");
do
@@ -751,7 +751,7 @@ long list_timer(void)
maxlen = RT_NAME_MAX;
- rt_kprintf("%-*.s periodic timeout activated mode\n", maxlen, item_title);
+ rt_kprintf("%-*.*s periodic timeout activated mode\n", maxlen, maxlen, item_title);
object_split(maxlen);
rt_kprintf(" ---------- ---------- ----------- ---------\n");
do
@@ -849,7 +849,7 @@ long list_device(void)
maxlen = RT_NAME_MAX;
- rt_kprintf("%-*.s type ref count\n", maxlen, item_title);
+ rt_kprintf("%-*.*s type ref count\n", maxlen, maxlen, item_title);
object_split(maxlen);
rt_kprintf(" -------------------- ----------\n");
do
diff --git a/components/utilities/ulog/ulog.c b/components/utilities/ulog/ulog.c
index 539f7ef24c..49c111a41c 100644
--- a/components/utilities/ulog/ulog.c
+++ b/components/utilities/ulog/ulog.c
@@ -1235,7 +1235,7 @@ static void ulog_filter(uint8_t argc, char **argv)
for (node = rt_slist_first(ulog_tag_lvl_list_get()); node; node = rt_slist_next(node))
{
tag_lvl = rt_slist_entry(node, struct ulog_tag_lvl_filter, list);
- rt_kprintf("%-*.s: ", ULOG_FILTER_TAG_MAX_LEN, tag_lvl->tag);
+ rt_kprintf("%-*.*s: ", ULOG_FILTER_TAG_MAX_LEN, ULOG_FILTER_TAG_MAX_LEN, tag_lvl->tag);
#ifndef ULOG_USING_SYSLOG
rt_kprintf("%s\n", lvl_name[tag_lvl->level]);