- return fwrite (buf, 1, buflen, stream) == 0 ? -1 : 0;
+ fwrite (buf, 1, buflen, stream);
+ return 0;
+}
+
+/* Simple failure callback that displays an error and exits. */
+static long
+exit_failure_callback (unsigned int code, const char *msg, void *callback_arg)
+{
+ if (msg == NULL)
+ error (1, 0, _("cannot convert U+%04X to local character set"), code);
+ else
+ error (1, 0, _("cannot convert U+%04X to local character set: %s"), code,
+ gettext (msg));
+ return -1;