Be paranoid about what we have read from the input file -- make sure the
2001-10-13 Bradford Hovinen <hovinen@ximian.com> * lister.c (edit_file_to_use): Be paranoid about what we have read from the input file -- make sure the string is always NULL-terminated
This commit is contained in:
parent
4b6d9f7f99
commit
5b60a269a7
3 changed files with 12 additions and 0 deletions
|
@ -40,6 +40,7 @@ edit_file_to_use(gchar *file, gchar *theme, gchar *font)
|
|||
}
|
||||
while (fgets(buf, sizeof(buf), fin))
|
||||
{
|
||||
buf[sizeof(buf)-1] = '\0'; /* Be paranoid */
|
||||
if (!strcmp(MARK_STRING, buf))
|
||||
hastheme += 1;
|
||||
}
|
||||
|
@ -56,6 +57,7 @@ edit_file_to_use(gchar *file, gchar *theme, gchar *font)
|
|||
nextline = 0;
|
||||
while (fgets(buf, sizeof(buf), fin))
|
||||
{
|
||||
buf[sizeof(buf)-1] = '\0'; /* Be paranoid */
|
||||
if (nextline == 1)
|
||||
nextline = 0;
|
||||
else if (!strcmp(MARK_STRING, buf))
|
||||
|
@ -72,6 +74,7 @@ edit_file_to_use(gchar *file, gchar *theme, gchar *font)
|
|||
nextline = 0;
|
||||
while (fgets(buf, sizeof(buf), fin))
|
||||
{
|
||||
buf[sizeof(buf)-1] = '\0'; /* Be paranoid */
|
||||
if (!strcmp(MARK_STRING, buf))
|
||||
{
|
||||
if (nextline == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue