[riot-notifications] [RIOT-OS/RIOT] sys/fmt_table: fix infinite loop (#15823)

Marian Buschsieweke notifications at github.com
Thu Jan 21 10:09:12 CET 2021


### Contribution description

In the loop, the counter variable wasn't decremented :-/ This PR fixes this

### Testing procedure

Apply

```diff
diff --git a/examples/hello-world/Makefile b/examples/hello-world/Makefile
index 258d8e9baf..5ce0559b9d 100644
--- a/examples/hello-world/Makefile
+++ b/examples/hello-world/Makefile
@@ -15,4 +15,6 @@ DEVELHELP ?= 1
 # Change this to 0 show compiler invocation lines by default:
 QUIET ?= 1
 
+USEMODULE += fmt_table
+
 include $(RIOTBASE)/Makefile.include
diff --git a/examples/hello-world/main.c b/examples/hello-world/main.c
index f51bf8c0a0..9d7dc038ba 100644
--- a/examples/hello-world/main.c
+++ b/examples/hello-world/main.c
@@ -21,12 +21,17 @@
 
 #include <stdio.h>
 
+#include "fmt.h"
+#include "fmt_table.h"
+
 int main(void)
 {
     puts("Hello World!");
 
     printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD);
     printf("This board features a(n) %s MCU.\n", RIOT_MCU);
+    print_col_u32_dec(1, 20);
+    print_str("\n");
 
     return 0;
 }
```

With that, `examples/hello-world` should print one additional line consisting of 20 chars, of which are 19 a space, and one being the digit "1".

### Issues/PRs references

None
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/15823

-- Commit Summary --

  * sys/fmt_table: fix infinite loop

-- File Changes --

    M sys/fmt/table.c (2)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/15823.patch
https://github.com/RIOT-OS/RIOT/pull/15823.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15823
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210121/3f133e7f/attachment.htm>


More information about the notifications mailing list