Skip to content

Commit

Permalink
r810: add err_puts()
Browse files Browse the repository at this point in the history
puts() adds '\n', but fputs() does not.
  • Loading branch information
lh3 committed Aug 26, 2014
1 parent b5cba25 commit 1e611b2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[]);
Expand Down
11 changes: 11 additions & 0 deletions utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1e611b2

Please sign in to comment.