summaryrefslogtreecommitdiff
path: root/src/escpos
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2019-02-25 09:19:32 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2019-02-25 09:19:32 +0200
commitb5ef40e9d388915b973efab43a9fbe57e80e21d1 (patch)
treea354da19839bb9bbd5f9f81c58231de1b5acff2a /src/escpos
parent46d63bca58c9ee8bfc590577ee374614cd813414 (diff)
fix warnings found by -D_FORTIFY_SOURCE=2HEADmaster
Diffstat (limited to 'src/escpos')
-rw-r--r--src/escpos/parser.rl4
1 files changed, 2 insertions, 2 deletions
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);
}