--- parser3/src/main/pa_common.C 2003/12/25 07:31:13 1.171 +++ parser3/src/main/pa_common.C 2004/02/11 15:33:15 1.174 @@ -1,11 +1,11 @@ /** @file Parser: commonly functions. - Copyright(c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright(c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_COMMON_C="$Date: 2003/12/25 07:31:13 $"; +static const char * const IDENT_COMMON_C="$Date: 2004/02/11 15:33:15 $"; #include "pa_common.h" #include "pa_exception.h" @@ -185,7 +185,7 @@ static int http_read_response(char*& res else throw Exception("http.response", 0, - "bad response from host - no status found (size=%lu)", response_size); + "bad response from host - no status found (size=%u)", response_size); } /* ********************** request *************************** */ @@ -544,7 +544,7 @@ static void file_read_action( if(ssize_t(*info.data_size)<0 || *info.data_size>to_read_size) throw Exception(0, &file_spec, - "read failed: actually read %l bytes count not in [0..%lu] valid range", + "read failed: actually read %u bytes count not in [0..%u] valid range", *info.data_size, to_read_size); } else { // empty file if(as_text) { @@ -1061,6 +1061,11 @@ int __vsnprintf(char* b, size_t s, const // note: on win32& maybe somewhere else // vsnprintf do not writes terminating 0 in 'buffer full' case, reducing --s; + + // clients do not check for negative 's', feature: ignore such prints + if((ssize_t)s<0) + return 0; + #if _MSC_VER /* win32: