From 42b5cbdfecbb75c9e07233bfd7137d19542fc801 Mon Sep 17 00:00:00 2001 From: OmarCastro Date: Sat, 9 May 2020 18:13:29 +0100 Subject: [PATCH] src: improvements on #4: code review & add exmaple - Code review pull request - Add icon character on show_lines example to show that even icon multibyte characters works --- examples/show_lines.sh | 1 + src/blocks.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/show_lines.sh b/examples/show_lines.sh index aa52d8a..6445e87 100755 --- a/examples/show_lines.sh +++ b/examples/show_lines.sh @@ -16,6 +16,7 @@ while printf ''; do {"text":"json with urgent flag", "urgent":true}, {"text":"json with highlight flag", "highlight": true}, {"text":"multi-byte unicode: •"}, + {"text":"icon unicode character: 😀"}, {"text":"json with markup flag", "markup": true}, {"text":"json toggling markup flag", "markup": $toggleMarkup}, {"text":"json without markup flag", "markup": false}, diff --git a/src/blocks.c b/src/blocks.c index f5821d2..e57d91f 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -146,7 +146,7 @@ typedef struct utils ***************/ -void json_escape(char *in, char *out) { +void json_escape(const char *in, char *out) { while (*in) { switch (*in) { case '\\':