* lib/bitset/stats.c (bitset_stats_read): Don't use errno after neither
fread() nor ferror() has set it. On native Windows, don't use errno
after fclose().
+2024-02-25 Bruno Haible <bruno@clisp.org>
+
+ bitset: Don't access errno when it's not set.
+ * lib/bitset/stats.c (bitset_stats_read): Don't use errno after neither
+ fread() nor ferror() has set it. On native Windows, don't use errno
+ after fclose().
+
2024-02-25 Bruno Haible <bruno@clisp.org>
bitset: Avoid newlines at the end of translatable strings.
1, file) != 1)
{
if (ferror (file))
- perror (_("cannot read stats file"));
+ fprintf (stderr, "%s\n", _("cannot read stats file"));
else
fprintf (stderr, "%s\n", _("bad stats file size"));
}
if (fclose (file) != 0)
- perror (_("cannot read stats file"));
+ {
+#if defined _WIN32 && !defined __CYGWIN__
+ fprintf (stderr, "%s\n", _("cannot read stats file"));
+#else
+ /* fclose() sets errno. */
+ perror (_("cannot read stats file"));
+#endif
+ }
}
bitset_stats_info_data.runs++;
}