@@ -95,7 +95,7 @@ XDI_readfile(char *filename, XDIFile *xdifile) {
95
95
char * header [MAX_LINES ];
96
96
char * words [MAX_WORDS ], * cwords [2 ];
97
97
char * col_labels [MAX_COLUMNS ], * col_units [MAX_COLUMNS ];
98
- char * c , * line , * mkey , * mval , * version_xdi , * version_extra ;
98
+ char * c , * line , * fullline , * mkey , * mval , * version_xdi , * version_extra ;
99
99
char * reword ;
100
100
char tlabel [32 ];
101
101
char comments [1024 ] = "" ;
@@ -189,7 +189,9 @@ XDI_readfile(char *filename, XDIFile *xdifile) {
189
189
190
190
if (strncmp (textlines [i ], TOK_COMM , 1 ) == 0 ) {
191
191
COPY_STRING (line , textlines [i ]);
192
+ COPY_STRING (fullline , textlines [i ]);
192
193
line ++ ;
194
+ fullline ++ ;
193
195
nwords = split_on (line , TOK_DELIM , words );
194
196
if (nwords < 1 ) { continue ; }
195
197
COPY_STRING (mkey , words [0 ]);
@@ -270,10 +272,10 @@ XDI_readfile(char *filename, XDIFile *xdifile) {
270
272
if ((strlen (comments ) > 0 ) && strlen (comments ) < sizeof (comments )) {
271
273
strncat (comments , "\n" , sizeof (comments )- strlen (comments ) - 1 );
272
274
}
273
- if (strlen (line ) + 1 > sizeof (comments ) - strlen (comments )) {
275
+ if (strlen (fullline ) + 1 > sizeof (comments ) - strlen (comments )) {
274
276
printf ("Warning.... user comment may be truncated!\n" );
275
277
}
276
- strncat (comments , line , sizeof (comments ) - strlen (comments ) - 1 );
278
+ strncat (comments , fullline , sizeof (comments ) - strlen (comments ) - 1 );
277
279
} else if (mode == 0 ) {
278
280
return ERR_META_FORMAT ;
279
281
}
0 commit comments