Renamed a couple of global variables to avoid shadowing warnings
This commit is contained in:
@@ -49,36 +49,36 @@ int test(char *URL)
|
||||
const char *buf_1 = "RNFR 505";
|
||||
const char *buf_2 = "RNTO 505-forreal";
|
||||
|
||||
if (!arg2) {
|
||||
if (!libtest_arg2) {
|
||||
fprintf(stderr, "Usage: <url> <file-to-upload>\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* get the file size of the local file */
|
||||
hd = stat(arg2, &file_info);
|
||||
hd = stat(libtest_arg2, &file_info);
|
||||
if(hd == -1) {
|
||||
/* can't open file, bail out */
|
||||
error = ERRNO;
|
||||
fprintf(stderr, "stat() failed with error: %d %s\n",
|
||||
error, strerror(error));
|
||||
fprintf(stderr, "WARNING: cannot open file %s\n", arg2);
|
||||
fprintf(stderr, "WARNING: cannot open file %s\n", libtest_arg2);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(! file_info.st_size) {
|
||||
fprintf(stderr, "WARNING: file %s has no size!\n", arg2);
|
||||
fprintf(stderr, "WARNING: file %s has no size!\n", libtest_arg2);
|
||||
return -4;
|
||||
}
|
||||
|
||||
/* get a FILE * of the same file, could also be made with
|
||||
fdopen() from the previous descriptor, but hey this is just
|
||||
an example! */
|
||||
hd_src = fopen(arg2, "rb");
|
||||
hd_src = fopen(libtest_arg2, "rb");
|
||||
if(NULL == hd_src) {
|
||||
error = ERRNO;
|
||||
fprintf(stderr, "fopen() failed with error: %d %s\n",
|
||||
error, strerror(error));
|
||||
fprintf(stderr, "Error opening file: %s\n", arg2);
|
||||
fprintf(stderr, "Error opening file: %s\n", libtest_arg2);
|
||||
return -2; /* if this happens things are major weird */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user