From b5ef40e9d388915b973efab43a9fbe57e80e21d1 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Mon, 25 Feb 2019 09:19:32 +0200 Subject: fix warnings found by -D_FORTIFY_SOURCE=2 --- src/escpos/parser.rl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/escpos/parser.rl') diff --git a/src/escpos/parser.rl b/src/escpos/parser.rl index 7cf828f..34f4055 100644 --- a/src/escpos/parser.rl +++ b/src/escpos/parser.rl @@ -75,7 +75,7 @@ render_chr(struct escpos_canvas *canvas, struct cursor *cursor, const struct ras } } } - cursor->x += MIN(glyph->width + SPACING, canvas->w - cursor->x); + cursor->x += MIN((size_t)glyph->width + SPACING, canvas->w - cursor->x); cursor->wy = MIN(cursor->y + MAX(raster->font.height, 1) - 1, canvas->h); } @@ -226,7 +226,7 @@ cut(const struct escpos_parser *parser, struct escpos_canvas *canvas, struct cur action text { putc(fc, stderr); - uint32_t cp; + uint32_t cp = 0; if (utf8_decode(&utf8.state, &cp, fc) == UTF8_ACCEPT) render_chr(&parser->print_buffer, &print_buffer_cursor, &raster, cp); } -- cgit v1.2.3