anonytmouse, I'd change your code into either:
Code:
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char * argv[])
{
if (argc == 5)
{
char cmdLine[4096];
sprintf(cmdLine, "/usr/local/script/send_it.pl %s %s %s %s",
argv[1], argv[2], argv[3], argv[4]);
return system(cmdLine);
}
printf("USAGE: sendit <keyname> <local file> <remote file> <speed>\n");
return EXIT_FAILURE;
}
No need for the ELSE clause
or
Code:
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char * argv[])
{
int rtn;
if (argc == 5)
{
char cmdLine[4096];
sprintf(cmdLine, "/usr/local/script/send_it.pl %s %s %s %s",
argv[1], argv[2], argv[3], argv[4]);
rtn = system(cmdLine);
}
else
{
printf("USAGE: sendit <keyname> <local file> <remote file> <speed>\n");
rtn = EXIT_FAILURE;
}
return rtn;
}
Use the preferred one-return-per-function format