diff --git a/pgrep.c b/pgrep.c index cf6ced95..28974242 100644 --- a/pgrep.c +++ b/pgrep.c @@ -338,7 +338,7 @@ do_regcomp (void) re_err = regcomp (preg, re, REG_EXTENDED | REG_NOSUB); if (re_err) { regerror (re_err, preg, errbuf, sizeof(errbuf)); - fprintf (stderr, errbuf); + fputs(errbuf,stderr); exit (2); } } diff --git a/proc/sysinfo.c b/proc/sysinfo.c index 8265dd37..dcec24c3 100644 --- a/proc/sysinfo.c +++ b/proc/sysinfo.c @@ -52,7 +52,7 @@ static char buf[1024]; #define FILE_TO_BUF(filename, fd) do{ \ static int local_n; \ if (fd == -1 && (fd = open(filename, O_RDONLY)) == -1) { \ - fprintf(stderr, BAD_OPEN_MESSAGE); \ + fputs(BAD_OPEN_MESSAGE, stderr); \ fflush(NULL); \ _exit(102); \ } \ @@ -79,7 +79,7 @@ int uptime(double *restrict uptime_secs, double *restrict idle_secs) { setlocale(LC_NUMERIC,"C"); if (sscanf(buf, "%lf %lf", &up, &idle) < 2) { setlocale(LC_NUMERIC,savelocale); - fprintf(stderr, "bad data in " UPTIME_FILE "\n"); + fputs("bad data in " UPTIME_FILE "\n", stderr); return 0; } setlocale(LC_NUMERIC,savelocale); @@ -222,7 +222,7 @@ static void init_libproc(void){ if(linux_version_code > LINUX_VERSION(2, 4, 0)){ Hertz = find_elf_note(AT_CLKTCK); if(Hertz!=NOTE_NOT_FOUND) return; - fprintf(stderr, "2.4+ kernel w/o ELF notes? -- report this\n"); + fputs("2.4+ kernel w/o ELF notes? -- report this\n", stderr); } old_Hertz_hack(); } @@ -300,7 +300,7 @@ void loadavg(double *restrict av1, double *restrict av5, double *restrict av15) savelocale = setlocale(LC_NUMERIC, NULL); setlocale(LC_NUMERIC, "C"); if (sscanf(buf, "%lf %lf %lf", &avg_1, &avg_5, &avg_15) < 3) { - fprintf(stderr, "bad data in " LOADAVG_FILE "\n"); + fputs("bad data in " LOADAVG_FILE "\n", stderr); exit(1); } setlocale(LC_NUMERIC, savelocale); diff --git a/pwdx.c b/pwdx.c index 0a59333c..ba8b16d2 100644 --- a/pwdx.c +++ b/pwdx.c @@ -22,7 +22,7 @@ static void die(const char *msg) NORETURN; static void die(const char *msg) { - fprintf(stderr, msg); + fputs(msg, stderr); exit(1); } diff --git a/vmstat.c b/vmstat.c index b2f1a9e7..386f9a5e 100644 --- a/vmstat.c +++ b/vmstat.c @@ -395,7 +395,7 @@ static void diskformat(void){ free(partitions); } }else{ - fprintf(stderr, "Your kernel doesn't support diskstat (2.5.70 or above required)"); + fprintf(stderr, "Your kernel doesn't support diskstat (2.5.70 or above required)\n"); exit(0); } } @@ -416,7 +416,7 @@ static void slabformat (void){ fSlab=fopen("/proc/slabinfo", "rb"); if(!fSlab){ - fprintf(stderr, "Your kernel doesn't support slabinfo"); + fprintf(stderr, "Your kernel doesn't support slabinfo.\n"); return; }