X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fglyphpoints.cpp;h=025f0e1ef3fde7be1c709ee943ada7084d23e7d9;hb=c7d608c4fcdd370274964cc861b674c2fae69468;hp=856b85964e5d1c5764f1d7020d6fa0cc9baa9e0c;hpb=0bd89e9489fa52f92545a7e94c4a31e863a5f898;p=ttedit diff --git a/src/glyphpoints.cpp b/src/glyphpoints.cpp index 856b859..025f0e1 100644 --- a/src/glyphpoints.cpp +++ b/src/glyphpoints.cpp @@ -907,24 +907,29 @@ bool GlyphPoints::LoadGlyphFromFile(FILE * file) FreeAllocatedMemory(); - fscanf(file, "%s V%f", line, &version); - fscanf(file, "%s %u", line, &numPoints); + int num = fscanf(file, "TTEGLYPH V%f\n", &version); + + // Check to see if this is really a glyph file + if ((num != 1) || (version != 1.0)) + return false; + + num = fscanf(file, "POINTS %u\n", &numPoints); x = new int[numPoints]; y = new int[numPoints]; onCurve = new bool[numPoints]; for(int i=0; i