From 56556a677e86f24462542f951043b2f8d7647c31 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 1 Jun 2014 20:37:26 +0100 Subject: [PATCH] Detect bad line endings and print error. --- framebuffer/convert_font.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framebuffer/convert_font.c b/framebuffer/convert_font.c index d71688e4c..b29c6edb7 100644 --- a/framebuffer/convert_font.c +++ b/framebuffer/convert_font.c @@ -781,6 +781,11 @@ static bool parse_chunk(struct parse_context *ctx, const char *buf, size_t len, } while (pos < end) { + if (*pos == '\r') { + LOG(LOG_ERROR, "Detected \'\\r\': Bad line ending\n"); + return false; + } + switch (ctx->state) { case START: if (*pos != '*') {