X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sources%2FTestRen.c;h=c6a3fba944853f38948367414835d772f013676d;hp=9e736defd574ab9a0c6551569b2c1e413840f010;hb=26f7a8bb19c6cb198c213757a97b6ac79e40db4b;hpb=7bd1670460aea5107ad0aeeb5f0639587ceb4399 diff --git a/sources/TestRen.c b/sources/TestRen.c index 9e736de..c6a3fba 100644 --- a/sources/TestRen.c +++ b/sources/TestRen.c @@ -26,8 +26,6 @@ * * Usage: testrem -h give all info's * - * $Id: TestRen.c,v 1.1 2002/01/03 23:44:14 piccardi Exp $ - * ****************************************************************/ /* * Include needed headers @@ -36,7 +34,7 @@ #include /* C standard library */ #include /* unix standard library */ #include /* standard I/O library */ -#include /* string functions */ +#include /* C strings library */ /* Help printing routine */ void usage(void); @@ -47,10 +45,13 @@ int main(int argc, char *argv[]) * Variables definition */ int i; + char *buf,*copy; /* * Input section: decode command line parameters * Use getopt function */ + buf = malloc(100); + opterr = 0; /* don't want writing to stderr */ while ( (i = getopt(argc, argv, "h")) != -1) { switch (i) { @@ -82,6 +83,7 @@ int main(int argc, char *argv[]) usage(); } if ( rename(argv[optind], argv[optind+1]) ) { + copy = strerror_r(errno, NULL, 0); perror("cannot rename"); exit(1); }