diff --git a/src/gdisp/mcufont/mf_encoding.c b/src/gdisp/mcufont/mf_encoding.c index 2c8abf3a..e0c89355 100644 --- a/src/gdisp/mcufont/mf_encoding.c +++ b/src/gdisp/mcufont/mf_encoding.c @@ -75,11 +75,16 @@ void mf_rewind(mf_str *str) #else -mf_char mf_getchar(mf_str *str) { - return *(*str)++; +mf_char mf_getchar(mf_str *str) +{ + if (!(**str)) + return 0; + else + return *(*str)++; } -void mf_rewind(mf_str *str) { +void mf_rewind(mf_str *str) +{ (*str)--; }