diff --git a/src/echo.c b/src/echo.c index e1d7704..1f71fc9 100644 --- a/src/echo.c +++ b/src/echo.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 @@ -27,11 +27,11 @@ static int _echo(int argc, char * argv[]) if(argc != 0) { - printf("%s", argv[0]); + fputs(argv[0], stdout); for(i = 1; i < argc; i++) printf(" %s", argv[i]); } - fputc('\n', stdout); + putchar('\n'); return 0; } @@ -55,5 +55,5 @@ int main(int argc, char * argv[]) default: return _usage(); } - return _echo(argc - 1, &argv[1]); + return _echo(argc - optind, &argv[optind]); }