diff options
| author | Franklin Wei <git@fwei.tk> | 2018-04-24 19:03:33 -0400 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2018-04-24 19:06:30 -0400 |
| commit | b29611fe2c629d8d951d969875a57132df055bdd (patch) | |
| tree | d12ccf676427bc843a5fea34f4f0048e18fc84eb /apps/plugins/puzzles/lz4tiny.c | |
| parent | 8f23493e08febc09c370b1d90d891953fa43ddf7 (diff) | |
| download | rockbox-b29611fe2c629d8d951d969875a57132df055bdd.zip rockbox-b29611fe2c629d8d951d969875a57132df055bdd.tar.gz rockbox-b29611fe2c629d8d951d969875a57132df055bdd.tar.bz2 rockbox-b29611fe2c629d8d951d969875a57132df055bdd.tar.xz | |
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
Diffstat (limited to 'apps/plugins/puzzles/lz4tiny.c')
| -rw-r--r-- | apps/plugins/puzzles/lz4tiny.c | 10 |
1 files changed, 9 insertions, 1 deletions
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 <stdlib.h> #include <stdio.h> @@ -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 |