1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
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);
|