Skip to content

Commit 1e611b2

Browse files
committed
r810: add err_puts()
puts() adds '\n', but fputs() does not.
1 parent b5cba25 commit 1e611b2

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "utils.h"
55

66
#ifndef PACKAGE_VERSION
7-
#define PACKAGE_VERSION "0.7.10-r809-dirty"
7+
#define PACKAGE_VERSION "0.7.10-r810-dirty"
88
#endif
99

1010
int bwa_fa2pac(int argc, char *argv[]);

utils.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,17 @@ int err_fputs(const char *s, FILE *stream)
219219
return ret;
220220
}
221221

222+
int err_puts(const char *s)
223+
{
224+
int ret = puts(s);
225+
if (EOF == ret)
226+
{
227+
_err_fatal_simple("puts", strerror(errno));
228+
}
229+
230+
return ret;
231+
}
232+
222233
int err_fflush(FILE *stream)
223234
{
224235
int ret = fflush(stream);

utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ extern "C" {
8080
int err_fputc(int c, FILE *stream);
8181
#define err_putchar(C) err_fputc((C), stdout)
8282
int err_fputs(const char *s, FILE *stream);
83-
#define err_puts(S) err_fputs((S), stdout)
83+
int err_puts(const char *s);
8484
int err_fflush(FILE *stream);
8585
int err_fclose(FILE *stream);
8686
int err_gzclose(gzFile file);

0 commit comments

Comments
 (0)