Permalink
Browse files

r810: add err_puts()

puts() adds '\n', but fputs() does not.
  • Loading branch information...
1 parent b5cba25 commit 1e611b235c8e37fd4d94e383543a2d8634deb3c1 @lh3 committed Aug 26, 2014
Showing with 13 additions and 2 deletions.
  1. +1 −1 main.c
  2. +11 −0 utils.c
  3. +1 −1 utils.h
View
2 main.c
@@ -4,7 +4,7 @@
#include "utils.h"
#ifndef PACKAGE_VERSION
-#define PACKAGE_VERSION "0.7.10-r809-dirty"
+#define PACKAGE_VERSION "0.7.10-r810-dirty"
#endif
int bwa_fa2pac(int argc, char *argv[]);
View
11 utils.c
@@ -219,6 +219,17 @@ int err_fputs(const char *s, FILE *stream)
return ret;
}
+int err_puts(const char *s)
+{
+ int ret = puts(s);
+ if (EOF == ret)
+ {
+ _err_fatal_simple("puts", strerror(errno));
+ }
+
+ return ret;
+}
+
int err_fflush(FILE *stream)
{
int ret = fflush(stream);
View
@@ -80,7 +80,7 @@ extern "C" {
int err_fputc(int c, FILE *stream);
#define err_putchar(C) err_fputc((C), stdout)
int err_fputs(const char *s, FILE *stream);
-#define err_puts(S) err_fputs((S), stdout)
+ int err_puts(const char *s);
int err_fflush(FILE *stream);
int err_fclose(FILE *stream);
int err_gzclose(gzFile file);

0 comments on commit 1e611b2

Please sign in to comment.