Use sizeof().
authorLaurent Monin <geeqie@norz.org>
Thu, 24 Apr 2008 15:31:21 +0000 (15:31 +0000)
committerLaurent Monin <geeqie@norz.org>
Thu, 24 Apr 2008 15:31:21 +0000 (15:31 +0000)
src/ui_bookmark.c

index eeb4928..797651f 100644 (file)
@@ -26,6 +26,7 @@
 #include "main.h"
 #include "filelist.h"
 
+#include "debug.h"
 #include "secure_save.h"
 #include "ui_bookmark.h"
 #include "ui_fileops.h"
@@ -94,14 +95,14 @@ gint history_list_load(const gchar *path)
        if (!f) return FALSE;
 
        /* first line must start with History comment */
-       if (!fgets(s_buf,1024,f) ||
+       if (!fgets(s_buf, sizeof(s_buf), f) ||
            strncmp(s_buf, "#History", 8) != 0)
                {
                fclose(f);
                return FALSE;
                }
 
-       while (fgets(s_buf,1024,f))
+       while (fgets(s_buf, sizeof(s_buf), f))
                {
                if (s_buf[0]=='#') continue;
                if (s_buf[0]=='[')