* detect and report fstat() errors which could lead to invalid
Content-Length being sent.
* remove some useless checks which were causing false positives by Coverity.
Detected by Coverity Scan. Issues 740334, 740379
break;
case 'A':
- if (optarg != NULL)
- useragent = optarg;
+ useragent = optarg;
break;
case 'h': /* remote host */
- if (optarg != NULL)
- hostname = optarg;
+ hostname = optarg;
break;
case 'j':
break;
case 'V':
- if (optarg != NULL)
- version = optarg;
+ version = optarg;
break;
case 'l': /* local host */
- if (optarg != NULL)
- localhost = optarg;
+ localhost = optarg;
break;
case 's': /* silent */
setmode(put_fd, O_BINARY);
#endif
- fstat(put_fd, &sb);
+ if (fstat(put_fd, &sb) < 0) {
+ fprintf(stderr, "%s: can't identify length of file (%s)\n", argv[0], xstrerror());
+ }
}
if (!host) {