diff options
author | Paul Gilbert | 2019-02-20 07:47:33 -0800 |
---|---|---|
committer | Paul Gilbert | 2019-02-20 07:47:33 -0800 |
commit | 7e09737067fedd5eeb2b2ef7d26575e3d1445ea1 (patch) | |
tree | 98fc0736da07ccfeb4201e33712621cd1268a49b | |
parent | c42e2a3243838d717e8a17387bbecb830a92415b (diff) | |
download | scummvm-rg350-7e09737067fedd5eeb2b2ef7d26575e3d1445ea1.tar.gz scummvm-rg350-7e09737067fedd5eeb2b2ef7d26575e3d1445ea1.tar.bz2 scummvm-rg350-7e09737067fedd5eeb2b2ef7d26575e3d1445ea1.zip |
GLK: FROTZ: Change fonts version check to not use atof
-rw-r--r-- | engines/glk/screen.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/engines/glk/screen.cpp b/engines/glk/screen.cpp index df2a288c1a..f493329409 100644 --- a/engines/glk/screen.cpp +++ b/engines/glk/screen.cpp @@ -81,14 +81,19 @@ void Screen::loadFonts() { } // Validate the version - char buffer[4]; - f.read(buffer, 3); - buffer[3] = '\0'; + char buffer[5]; + f.read(buffer, 4); + buffer[4] = '\0'; + + int major = 0, minor = 0; + if (buffer[1] == '.') { + major = buffer[0] - '0'; + minor = atoi(&buffer[2]); + } - double version = atof(buffer); - if (version < 1.2) { + if (major < 1 || minor < 2) { delete archive; - error("Out of date fonts. Expected at least %f, but got version %f", 1.2, version); + error("Out of date fonts. Expected at least %s, but got version %d.%d", "1.2", major, minor); } loadFonts(archive); |