sys/fmt_table: fix infinite loop

This commit is contained in:
Marian Buschsieweke 2021-01-21 09:57:24 +01:00
parent b35e4f4a95
commit 00a8a8bd83
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -25,6 +25,7 @@
#include <string.h>
#include "fmt.h"
#include "fmt_table.h"
static const char fmt_table_spaces[16] = " ";
@ -43,6 +44,7 @@ static void print_pattern(const char *pat, size_t pat_size, size_t fill_size)
{
while (fill_size > pat_size) {
print(pat, pat_size);
fill_size -= pat_size;
}
print(pat, fill_size);