[neatx commit] r16 - - Fix the check for no args

4 views
Skip to first unread message

codesite...@google.com

unread,
Jul 16, 2009, 5:34:39 AM7/16/09
to ne...@googlegroups.com
Author: kormat
Date: Thu Jul 16 02:28:36 2009
New Revision: 16

Modified:
trunk/neatx/src/fdcopy.c

Log:
- Fix the check for no args
- Strip dirs from progname

Reviewed-By: imsnah


Modified: trunk/neatx/src/fdcopy.c
==============================================================================
--- trunk/neatx/src/fdcopy.c (original)
+++ trunk/neatx/src/fdcopy.c Thu Jul 16 02:28:36 2009
@@ -27,11 +27,12 @@

#include <errno.h>
#include <fcntl.h>
+#include <libgen.h>
+#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <signal.h>

#undef MAX
#define MAX(a, b) (((a) > (b))?(a):(b))
@@ -313,9 +314,9 @@
int ret;
int i;

- progname = argv[0];
+ progname = basename(strdup(argv[0]));

- if (argc < 1)
+ if (argc < 2)
usage();

memset(&channel, 0, sizeof(channel));

Reply all
Reply to author
Forward
0 new messages