From b29611fe2c629d8d951d969875a57132df055bdd Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Tue, 24 Apr 2018 19:03:33 -0400 Subject: puzzles: update help text, make generation and testing cleaner This includes an upstream change to the Galaxies help text. `genhelp.sh' no longer leaves temporary files sitting around, and the self-test feature of lz4tiny.c works again. Change-Id: I787f4cb3c258baade31638d6be18f95b7aa0705e --- apps/plugins/puzzles/lz4tiny.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'apps/plugins/puzzles/lz4tiny.c') diff --git a/apps/plugins/puzzles/lz4tiny.c b/apps/plugins/puzzles/lz4tiny.c index 8244ede..8badbbb 100644 --- a/apps/plugins/puzzles/lz4tiny.c +++ b/apps/plugins/puzzles/lz4tiny.c @@ -188,6 +188,8 @@ void LZ4_decompress_tiny(const char* const source, char* const dest, int outputS /* testing code */ #ifndef ROCKBOX +#define LZ4TINY + #include "help.h" #include #include @@ -195,7 +197,13 @@ int main() { char *buf = malloc(help_text_len); LZ4_decompress_tiny(help_text, buf, help_text_len); - puts(buf); + int col = 0; + for(int i = 0; i < help_text_len; ++i) + { + char c = buf[i]; + printf("%c", (col++, !c ? (col >= 80 ? (col = 0, '\n') : ' ') : c)); + } + puts(""); free(buf); } #endif -- cgit v1.1