Enable extra compiler checks and correct warnings.

This commit is contained in:
Lefteris Chatzimparmpas 2012-08-20 20:22:54 +02:00
parent 69b650137a
commit 7dec2a8ec7
4 changed files with 6 additions and 6 deletions

View File

@ -16,7 +16,7 @@ LIBPCRE = -lpcre
LIBSSL = -lssl
LIBCRYPTO = -lcrypto
CFLAGS = -Wall -O -DCONFIG_SHAREDIR='"$(SHAREDIR)"' $(INCDIRS) $(MYCFLAGS)
CFLAGS = -Wall -Wextra -O -DCONFIG_SHAREDIR='"$(SHAREDIR)"' $(INCDIRS) $(MYCFLAGS)
LDFLAGS = $(LIBDIRS) $(MYLDFLAGS)
LIBS = -lm $(LIBLUA) $(LIBPCRE) $(LIBSSL) $(LIBCRYPTO) $(MYLIBS)

View File

@ -51,7 +51,7 @@ debug(const char *fmt,...)
{
va_list args;
if (opts.debug <= 0 || !debugfp)
if (!opts.debug || !debugfp)
return;
va_start(args, fmt);
@ -68,7 +68,7 @@ void
debugc(char c)
{
if (opts.debug <= 0 || !debugfp)
if (!opts.debug || !debugfp)
return;
fputc(c, debugfp);

View File

@ -308,12 +308,12 @@ reverse_conversion(const char *mbox)
}
/* Convert from Unicode to UTF-8. */
if (ucp[0] >= 0x00 && ucp[0] <= 0x07) {
if (ucp[0] <= 0x07) {
*out++ = 0xC0 | (ucp[0] << 2 & 0x1C) |
(ucp[1] >> 6 & 0x03);
*out++ = 0x80 | (ucp[1] & 0x3F);
} else if ((ucp[0] >= 0x08 && ucp[0] <= 0xD7) ||
(ucp[0] >= 0xE0 && ucp[0] <= 0xFF)) {
ucp[0] >= 0xE0) {
*out++ = 0xE0 | (ucp[0] >> 4 & 0x0F);
*out++ = 0x80 | (ucp[0] << 2 & 0x1C) |
(ucp[1] >> 6 & 0x03);

View File

@ -168,7 +168,7 @@ int
check_preauth(char *buf)
{
if (xstrcasestr(ibuf.data, "* PREAUTH"))
if (xstrcasestr(buf, "* PREAUTH"))
return 1;
else
return 0;