Index: lyx2html-0.2/document.c =================================================================== --- lyx2html-0.2.orig/document.c +++ lyx2html-0.2/document.c @@ -70,7 +70,7 @@ void documentParseSubSubSection(LYXDOCUM if (start) { - if(!fgets(theline, filesize, read)) + if(!fgets(theline, sizeof(theline), read)) { break; } @@ -114,7 +114,7 @@ void documentParseSubSubSection(LYXDOCUM documentParseSection(doc, read, filename); return; } - } while (fgets(theline,filesize,read)); + } while (fgets(theline,sizeof(theline),read)); } void documentParseSubSection(LYXDOCUMENT *doc, FILE *read, char * filename) @@ -131,7 +131,7 @@ void documentParseSubSection(LYXDOCUMENT if (start) { - if(!fgets(theline, filesize, read)) + if(!fgets(theline, sizeof(theline), read)) { break; } @@ -173,7 +173,7 @@ void documentParseSubSection(LYXDOCUMENT subsubsec++; documentParseSubSubSection(doc, read, filename); } - } while (fgets(theline,filesize,read)); + } while (fgets(theline,sizeof(theline),read)); } int documentSubSection(LYXDOCUMENT *doc, char * line) @@ -212,7 +212,7 @@ void documentParseSection (LYXDOCUMENT * if (start) { - if(!fgets(theline, filesize, read)) + if(!fgets(theline, sizeof(theline), read)) { break; } @@ -242,7 +242,7 @@ void documentParseSection (LYXDOCUMENT * subsubsec = 0; documentParseSubSection(doc, read, filename); } - } while (fgets(theline,filesize,read)); + } while (fgets(theline,sizeof(theline),read)); } struct LYXDOCUMENT * initNewDoc() @@ -288,7 +288,7 @@ struct LYXDOCUMENT * newDoc(char *create int abstract = 0; int start = 0; - while (fgets(theline,filesize,read)) + while (fgets(theline,sizeof(theline),read)) { linenum++; Index: lyx2html-0.2/section.c =================================================================== --- lyx2html-0.2.orig/section.c +++ lyx2html-0.2/section.c @@ -34,7 +34,7 @@ struct SECTION * newSection(SECTYPE type { struct SECTION *init; - init = malloc(filesize); + init = malloc(sizeof(struct SECTION)); /* limit for the name of section is hardcoded */ init->name = malloc(240);