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:
Bradford Hovinen 2001-10-13 19:19:16 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent 4b6d9f7f99
commit 5b60a269a7
3 changed files with 12 additions and 0 deletions

View file

@ -1,3 +1,9 @@
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
2001-09-29 Richard Hestilow <hestilow@ximian.com>
* gui.c (sort_alpha): Use g_strcasecmp, not strcmp.

View file

@ -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)

View file

@ -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)