Date: Tue, 19 May 2009 20:16:18 +0000 (UTC) From: "George V. Neville-Neil" <gnn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r192407 - head/usr.bin/perror Message-ID: <200905192016.n4JKGI5R008830@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gnn Date: Tue May 19 20:16:18 2009 New Revision: 192407 URL: http://svn.freebsd.org/changeset/base/192407 Log: Fix a few style(9) nits. Submitted by: danfe Modified: head/usr.bin/perror/perror.c Modified: head/usr.bin/perror/perror.c ============================================================================== --- head/usr.bin/perror/perror.c Tue May 19 19:45:36 2009 (r192406) +++ head/usr.bin/perror/perror.c Tue May 19 20:16:18 2009 (r192407) @@ -35,15 +35,17 @@ __FBSDID("$FreeBSD$"); #define MAX_ERR 256 -void usage() +static void +usage() { - printf("usage: perror number\n"); - printf("number must be between 1 and %d\n", ELAST); + fprintf(stderr, "usage: perror number\n"); + fprintf(stderr, "number must be between 1 and %d\n", ELAST); exit(1); } -int main(int argc, char **argv) +int +main(int argc, char **argv) { char errstr[MAX_ERR]; @@ -56,17 +58,17 @@ int main(int argc, char **argv) errnum = strtol(argv[1], &cp, 0); if (((errnum == 0) && (errno == EINVAL)) || (*cp != '\0')) { - printf("Argument %s not a number.\n", argv[1]); + fprintf(stderr, "Argument %s not a number.\n", argv[1]); usage(); } if ((errnum <=0) || (errnum > ELAST)) { - printf("Number %d out of range.\n", errnum); + fprintf(stderr, "Number %d out of range.\n", errnum); usage(); } if (strerror_r(errnum, errstr, sizeof(errstr)) < 0) { - printf("Could not find error number %d.\n", errnum); + fprintf(stderr, "Could not find error number %d.\n", errnum); usage(); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905192016.n4JKGI5R008830>