diff --git a/geo.c b/geo.c index 3c52cad..57c2856 100644 --- a/geo.c +++ b/geo.c @@ -90,7 +90,7 @@ AI_geoinfobyaddr ( const char *ip, double **coord ) fprintf ( fp, "POST /index.html HTTP/1.1\r\n" "Host: www.hostip.info\r\n" - "Content-Length: %u\r\n" + "Content-Length: %lu\r\n" "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n" "Connection: close\r\n\r\n" "%s\r\n", diff --git a/kb.c b/kb.c index 6230a3e..10c422a 100644 --- a/kb.c +++ b/kb.c @@ -44,7 +44,7 @@ PRIVATE AI_hyperalert_info *hyperalerts = NULL; PRIVATE char* __AI_get_function_name ( const char *orig_stmt ) { - int parenthesis_pos, function_name_len; + unsigned long int parenthesis_pos, function_name_len; char function_name[4096]; char *stmt = NULL; @@ -54,10 +54,10 @@ __AI_get_function_name ( const char *orig_stmt ) memset ( function_name, 0, sizeof ( function_name )); - if ( !( parenthesis_pos = (int) strstr ( stmt, "(" ))) + if ( !( parenthesis_pos = (unsigned long int) strstr ( stmt, "(" ))) return NULL; - parenthesis_pos -= (int) stmt; + parenthesis_pos -= (unsigned long int) stmt; function_name_len = ( parenthesis_pos < sizeof ( function_name )) ? parenthesis_pos : sizeof ( function_name ); strncpy ( function_name, stmt, function_name_len ); @@ -78,17 +78,17 @@ __AI_get_function_arguments ( char *orig_stmt, int *n_args ) char **args = NULL; char *tok = NULL; char *stmt = NULL; - int par_pos = 0; + unsigned long int par_pos = 0; *n_args = 0; if ( !( stmt = (char*) alloca ( strlen ( orig_stmt )))) return NULL; strcpy ( stmt, orig_stmt ); - if ( !( par_pos = (int) strstr ( stmt, "(" ))) + if ( !( par_pos = (unsigned long int) strstr ( stmt, "(" ))) return NULL; - par_pos -= (int) stmt; + par_pos -= (unsigned long int) stmt; stmt += par_pos + 1; if ( stmt [ strlen(stmt) - 1 ] == ')' ) diff --git a/regex.c b/regex.c index 9f7d591..5703e32 100644 --- a/regex.c +++ b/regex.c @@ -164,7 +164,7 @@ str_replace ( char *str, char *orig, char *rep ) unsigned long int new_len = 0; unsigned long int pos = 0; - if ( !( pos = (int) strstr ( str, orig ))) + if ( !( pos = (unsigned long int) strstr ( str, orig ))) return str; new_len = strlen(str) - strlen(orig) + ((rep) ? strlen(rep) : 0) + 1; diff --git a/spp_ai.c b/spp_ai.c index 45d7924..536ba9e 100644 --- a/spp_ai.c +++ b/spp_ai.c @@ -186,8 +186,8 @@ static AI_config * AI_parse(char *args) int nmatches = 0; int i; - int offset; int len; + unsigned long int offset; double corr_threshold_coefficient = DEFAULT_CORR_THRESHOLD; uint32_t netmask; @@ -1174,7 +1174,7 @@ static AI_config * AI_parse(char *args) type = none; match = strdup ( matches[1] ); - offset = (int) strcasestr ( args, matches[0] ) - (int) args; + offset = (unsigned long int) strcasestr ( args, matches[0] ) - (unsigned long int) args; len = strlen ( matches[0] ); for ( i=0; i < nmatches; i++ ) @@ -1339,7 +1339,7 @@ static AI_config * AI_parse(char *args) } } - for ( i=offset; i <= strlen(args); i++ ) + for ( i = (int) offset; i <= strlen(args); i++ ) args[i] = args[ i+len ]; if ( min_val == -1 || max_val == -1 || type == none || strlen ( label ) == 0 ) diff --git a/stream.c b/stream.c index e040934..5e699f2 100644 --- a/stream.c +++ b/stream.c @@ -268,7 +268,7 @@ AI_pkt_enqueue ( SFSnortPacket* pkt ) for ( ; found->next; found = found->next ) { /* Stupid memory bug fixed in a stupid and unelegant way */ - if ( (int) found->next->pkt < 0x100 ) + if ( (unsigned long int) found->next->pkt < 0x100 ) break; /* If the sequence number of the next packet in the stream diff --git a/webserv.c b/webserv.c index 588342e..ac73e97 100644 --- a/webserv.c +++ b/webserv.c @@ -33,7 +33,7 @@ "Date: %s\r\n" \ "Server: %s\r\n" \ "Content-Type: %s\r\n" \ - "Content-Length: %u\r\n\r\n" + "Content-Length: %lu\r\n\r\n" #define HTTP_CGI_RESPONSE_HEADERS_FORMAT "%s %d %s\r\n" \ "Date: %s\r\n" \ @@ -42,7 +42,7 @@ #define HTTP_ERR_RESPONSE_FORMAT "\n" \ "\n" \ - "%u %s\n" \ + "%lu %s\n" \ "\n" \ "

%s

\n" \ "

%s

\n" \