]> www.fi.muni.cz Git - evince.git/blobdiff - backend/dvi/mdvi-lib/afmparse.c
help/C: documented toolbar (bug # 503638)
[evince.git] / backend / dvi / mdvi-lib / afmparse.c
index 5b8ac680906f617bf057370e07ea123a69d3a267..f90e557567508f16a7664f9dd27f36e476f19a4f 100644 (file)
@@ -56,6 +56,7 @@
  *    - changed (width == 250) to (width = 250) in initializeArray
  */
 
  *    - changed (width == 250) to (width = 250) in initializeArray
  */
 
+#include <config.h>
 #include "sysdeps.h"
 
 #ifdef WITH_AFM_FILES
 #include "sysdeps.h"
 
 #ifdef WITH_AFM_FILES
@@ -159,7 +160,7 @@ static char *token(FILE *stream)
     
     idx = 0;
     while (ch != EOF && ch != ' ' && ch != lineterm 
     
     idx = 0;
     while (ch != EOF && ch != ' ' && ch != lineterm 
-           && ch != '\t' && ch != ':' && ch != ';'
+           && ch != '\t' && ch != ':' && ch != ';' && idx < (MAX_NAME - 1))
     {
         ident[idx++] = ch;
         ch = fgetc(stream);
     {
         ident[idx++] = ch;
         ch = fgetc(stream);
@@ -189,7 +190,7 @@ static char *linetoken(FILE *stream)
     while ((ch = fgetc(stream)) == ' ' || ch == '\t' ); 
     
     idx = 0;
     while ((ch = fgetc(stream)) == ' ' || ch == '\t' ); 
     
     idx = 0;
-    while (ch != EOF && ch != lineterm
+    while (ch != EOF && ch != lineterm && idx < (MAX_NAME - 1))
     {
         ident[idx++] = ch;
         ch = fgetc(stream);
     {
         ident[idx++] = ch;
         ch = fgetc(stream);