fixed a wrong data type of a parameter passed to ioctl.

fixed the segfault when no host configuration is in the configuration file
This commit is contained in:
2013-04-02 14:28:33 +00:00
parent 15924c72cd
commit 010b5fb9c0
9 changed files with 3420 additions and 3380 deletions

View File

@ -377,17 +377,19 @@ qse_mchar_t* qse_fmthttptime (
/* TODO: avoid using snprintf () */
#if defined(_MSC_VER) || (defined(__WATCOMC__) && (__WATCOMC__ < 1200))
_snprintf (buf, bufsz,
#else
snprintf (buf, bufsz,
#if defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && (__WATCOMC__ < 1200))
# define snprintf _snprintf
#endif
snprintf (
buf, bufsz,
QSE_MT("%s, %d %s %d %02d:%02d:%02d GMT"),
wday_name[bt.wday].s,
bt.mday,
mon_name[bt.mon].s,
bt.year + QSE_BTIME_YEAR_BASE,
bt.hour, bt.min, bt.sec);
bt.hour, bt.min, bt.sec
);
return buf;
}

View File

@ -928,7 +928,7 @@ static int peer_open (qse_httpd_t* httpd, qse_httpd_peer_t* peer)
#elif defined(__OS2__)
cmd = 1;
if (ioctl(fd, FIONBIO, &cmd, QSE_SIZEOF(cmd)) == -1) goto oops;
if (ioctl(fd, FIONBIO, (char*)&cmd, QSE_SIZEOF(cmd)) == -1) goto oops;
if (connect (fd, (struct sockaddr*)&connaddr, connaddrsize) == -1)
{
@ -937,7 +937,7 @@ static int peer_open (qse_httpd_t* httpd, qse_httpd_peer_t* peer)
}
cmd = 0;
if (ioctl(fd, FIONBIO, &cmd, QSE_SIZEOF(cmd)) == -1) goto oops;
if (ioctl(fd, FIONBIO, (char*)&cmd, QSE_SIZEOF(cmd)) == -1) goto oops;
#elif defined(__DOS__)