summaryrefslogtreecommitdiffstats
path: root/src/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/text.c')
-rw-r--r--src/text.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/text.c b/src/text.c
index dda6de1..fedbd3f 100644
--- a/src/text.c
+++ b/src/text.c
@@ -33,15 +33,15 @@
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
struct text {
- size_t size;
- size_t read;
- char *string;
- size_t width;
- size_t height;
+ size_t size;
+ size_t read;
+ unsigned char *string;
+ size_t width;
+ size_t height;
};
-static char
-_getc(struct text *text, FILE *stream, char *c)
+static unsigned char
+_getc(struct text *text, FILE *stream, unsigned char *c)
{
int i_c;
@@ -60,10 +60,10 @@ _getc(struct text *text, FILE *stream, char *c)
struct text *
text_new(FILE *stream)
{
- struct text *text;
- size_t width;
- int eol;
- char c;
+ struct text *text;
+ size_t width;
+ int eol;
+ unsigned char c;
if (!stream) {
return NULL;
@@ -131,19 +131,20 @@ text_set_height(struct text *text, size_t height)
void
text_render(struct text *text, struct font *font, png_bytepp rows)
{
- char *string_start;
- char *string;
- size_t row;
- size_t col;
- char *parameter;
+ unsigned char *string_start;
+ unsigned char *string;
+ size_t row;
+ size_t col;
+ unsigned char *parameter;
png_color fg = {170, 170, 170};
png_color bg = { 0, 0, 0};
- string_start = calloc(strlen(text->string) + 1, sizeof(*text->string));
+ string_start = calloc(strlen((char *) text->string) + 1,
+ sizeof(*text->string));
if (!string_start) {
return;
}
- memcpy(string_start, text->string, strlen(text->string) + 1);
+ memcpy(string_start, text->string, strlen((char *) text->string) + 1);
string = string_start;
row = 0;