From ef192344c088aaae5355af13147762e6ef1c083e Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Sat, 23 Sep 2017 22:42:20 +0900 Subject: fmp: fixed z8x detection --- fmdriver/fmdriver_fmp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'fmdriver') diff --git a/fmdriver/fmdriver_fmp.c b/fmdriver/fmdriver_fmp.c index 54f6753..9abfaaa 100644 --- a/fmdriver/fmdriver_fmp.c +++ b/fmdriver/fmdriver_fmp.c @@ -3208,20 +3208,20 @@ static void fmp_title( int l = 0; int li = 0; for (int si = 0;; si++) { - if (l >= 3) { - // Z8X - fmp->pdzf.mode = 1; - return; - } if ((offset + si) >= fmp->datalen) { - fmp->comment[l][0] = 0; + if (l < 3) fmp->comment[l][0] = 0; return; } if (li >= FMP_COMMENT_BUFLEN) { - fmp->comment[l][0] = 0; + if (l < 3) fmp->comment[l][0] = 0; return; } uint8_t c = fmp->data[offset+si]; + if (l >= 3) { + // Z8X + if (c) fmp->pdzf.mode = 1; + return; + } if (c == '\r') { continue; } else if (c == '\n') { -- cgit v1.2.3