static curl_socket_t peer = CURL_SOCKET_BAD;
-static int timeout;
-static int maxtimeout = 5 * TIMEOUT;
+static unsigned int timeout;
+static unsigned int maxtimeout = 5 * TIMEOUT;
#ifdef ENABLE_IPV6
static bool use_ipv6 = FALSE;
static const char *ipv_inuse = "IPv4";
const char *serverlogfile = DEFAULT_LOGFILE;
-static char *pidname= (char *)".tftpd.pid";
+static const char *pidname = ".tftpd.pid";
static int serverlogslocked = 0;
static int wrotepidfile = 0;
#endif
#if defined(HAVE_ALARM) && defined(SIGALRM)
-static int rexmtval = TIMEOUT;
+static const unsigned int rexmtval = TIMEOUT;
#endif
/* do-nothing macro replacement for systems which lack siginterrupt() */
}
else {
if(test->rcount) {
- c=test->rptr[0];
+ c = test->rptr[0];
test->rptr++;
test->rcount--;
}
char outfile[256];
snprintf(outfile, sizeof(outfile), "log/upload.%ld", test->testno);
#ifdef WIN32
- test->ofile=open(outfile, O_CREAT|O_RDWR|O_BINARY, 0777);
+ test->ofile = open(outfile, O_CREAT|O_RDWR|O_BINARY, 0777);
#else
- test->ofile=open(outfile, O_CREAT|O_RDWR, 0777);
+ test->ofile = open(outfile, O_CREAT|O_RDWR, 0777);
#endif
if(test->ofile == -1) {
logmsg("Couldn't create and/or open file %s for upload!", outfile);
#ifdef USE_WINSOCK
DWORD recvtimeout, recvtimeoutbak;
#endif
- char *option = (char *)"mode"; /* mode is implicit */
+ const char *option = "mode"; /* mode is implicit */
int toggle = 1;
/* Open request dump file. */
/* before increasing pointer, make sure it is still within the legal
space */
- if((cp+1) < &buf.storage[size]) {
+ if((cp + 1) < &buf.storage[size]) {
++cp;
if(first) {
/* store the mode since we need it later */
filename = test2file(req->testno);
- stream=fopen(filename, "rb");
+ stream = fopen(filename, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
char *orgcmd = NULL;
char *cmd = NULL;
size_t cmdsize = 0;
- int num=0;
+ int num = 0;
/* get the custom server control "commands" */
error = getpart(&orgcmd, &cmdsize, "reply", "servercmd", stream);
snprintf(partbuf, sizeof(partbuf), "data%ld", partno);
if(file) {
- FILE *stream=fopen(file, "rb");
+ FILE *stream = fopen(file, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));