File splashy-0.3.8-fix-compiler-warnings.patch of Package splashy
--- src/splashy_functions.c
+++ src/splashy_functions.c
@@ -196,14 +196,22 @@
buffer = g_try_malloc (max_buf);
if (buffer && (fp = g_fopen (filename, "r")))
{
- fread_unlocked (buffer, max_buf, 1, fp); /* *_unlocked
- * are a GNU
- * extension:
- * makes
- * function
- * fread()
- * thread
- * safe */
+ /* *_unlocked
+ * are a GNU
+ * extension:
+ * makes
+ * function
+ * fread()
+ * thread
+ * safe */
+ if (fread_unlocked (buffer, max_buf, 1, fp) == 0) {
+ ERROR_PRINT ("Cannot read from file %s\n", filename);
+ fclose (fp);
+ if (buffer)
+ g_free (buffer);
+ return FALSE;
+ }
+
fclose (fp);
buffer[max_buf - 1] = '\0';
ret = search_pattern (perr_pattern, buffer, use_ignore);