From 4c6a1dcd647b208a59e3b23ad0aaf0a25397f6ad Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 2 Jan 2012 02:16:14 -0800 Subject: grep: prefer fgets to printf, _ to gettext * lib/colorize.h (print_end_colorize): * lib/ms/colorize-impl.c (print_end_colorize): Use fputs instead of printf. * src/main.c (usage): Likewise. Use _ instead of gettext. --- lib/colorize.h | 2 +- lib/ms/colorize-impl.c | 2 +- src/main.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/colorize.h b/lib/colorize.h index 7890fbc8..104f7a03 100644 --- a/lib/colorize.h +++ b/lib/colorize.h @@ -33,5 +33,5 @@ print_start_colorize (char const *sgr_start, char const *sgr_seq) static inline void print_end_colorize (char const *sgr_end) { - printf ("%s", sgr_end); + fputs (sgr_end, stdout); } diff --git a/lib/ms/colorize-impl.c b/lib/ms/colorize-impl.c index 3c8c73ab..d9d9b959 100644 --- a/lib/ms/colorize-impl.c +++ b/lib/ms/colorize-impl.c @@ -212,5 +212,5 @@ print_end_colorize (char const *sgr_end) w32_clreol (); } else - printf ("%s", sgr_end); + fputs (sgr_end, stdout); } diff --git a/src/main.c b/src/main.c index 3376fa46..a1d590a2 100644 --- a/src/main.c +++ b/src/main.c @@ -1426,7 +1426,7 @@ usage (int status) printf (_("Usage: %s [OPTION]... PATTERN [FILE]...\n"), program_name); printf (_("\ Search for PATTERN in each FILE or standard input.\n")); - printf ("%s", gettext (before_options)); + fputs (_(before_options), stdout); printf (_("\ Example: %s -i 'hello world' menu.h main.c\n\ \n\ @@ -1507,7 +1507,7 @@ Context control:\n\ -u, --unix-byte-offsets report offsets as if CRs were not there\n\ (MSDOS/Windows)\n\ \n")); - printf ("%s", _(after_options)); + fputs (_(after_options), stdout); printf (_("\ With no FILE, or when FILE is -, read standard input. If less than two FILEs\n\ are given, assume -h. Exit status is 0 if any line was selected, 1 otherwise;\n\ -- cgit v1.2.1