diff --git a/src/tty.c b/src/tty.c index ae1e44a..c66012e 100644 --- a/src/tty.c +++ b/src/tty.c @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2007 Pierre Pronchery */ +/* Copyright (c) 2009 Pierre Pronchery */ /* This file is part of DeforaOS Unix utils */ /* utils is not free software; you can redistribute it and/or modify it under * the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 @@ -22,6 +22,7 @@ /* tty */ static int _tty_error(char const * message, int ret); + static int _tty(void) { char * tty; @@ -30,10 +31,10 @@ static int _tty(void) { if((tty = ttyname(0)) == NULL) return _tty_error("ttyname", 2); - printf("%s\n", tty); + puts(tty); return 0; } - printf("%s", "not a tty\n"); + puts("not a tty"); return 1; } diff --git a/src/uniq.c b/src/uniq.c index 9e48dc9..dd1e522 100644 --- a/src/uniq.c +++ b/src/uniq.c @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2007 Pierre Pronchery */ +/* Copyright (c) 2009 Pierre Pronchery */ /* This file is part of DeforaOS Unix utils */ /* utils is not free software; you can redistribute it and/or modify it under * the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 @@ -35,6 +35,7 @@ static int _uniq_error(char const * message, int ret); static int _uniq_do(int opts, char const * fields, unsigned int skip, FILE * infp, FILE * outfp); + static int _uniq(int opts, char const * fields, unsigned int skip, char const * in, char const * out) { @@ -166,6 +167,8 @@ static int _usage(void) return 1; } + +/* main */ int main(int argc, char * argv[]) { int opts = 0; @@ -206,5 +209,5 @@ int main(int argc, char * argv[]) else if(argc - optind > 2) return _usage(); } - return _uniq(opts, fields, skip, in, out) == 0 ? 0 : 2; + return (_uniq(opts, fields, skip, in, out) == 0) ? 0 : 2; }