aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-08-05 17:36:31 +0200
committerMattias Andrée <maandree@kth.se>2021-08-05 17:36:59 +0200
commit7cd9ec4cc97e472298f5becebe73bef7cc8401db (patch)
treea50366d6359a3405741020f15a2a12090909a569
parentminor fixes and cleanups, and update to use new version of libgrapheme and add text length parameter instead of using NUL-termination (diff)
downloadlibskrift-7cd9ec4cc97e472298f5becebe73bef7cc8401db.tar.gz
libskrift-7cd9ec4cc97e472298f5becebe73bef7cc8401db.tar.bz2
libskrift-7cd9ec4cc97e472298f5becebe73bef7cc8401db.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--demo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/demo.c b/demo.c
index 4920de1..d86385e 100644
--- a/demo.c
+++ b/demo.c
@@ -5,6 +5,8 @@
#include <string.h>
#include <unistd.h>
+#define TEST_TEXT "hello world"
+
int
main(void)
{
@@ -54,7 +56,7 @@ main(void)
((uint8_t *)image.image)[i + 3] = 250U;
}
- if (libskrift_draw_text(ctx, "hello world", strlen("hello world"), &colour, 0, 300, &image) < 0) {
+ if (libskrift_draw_text(ctx, TEST_TEXT, sizeof(TEST_TEXT) - 1, &colour, 0, 300, &image) < 0) {
perror("libskrift_draw_text");
return -1;
}