--- C:\builds\redland-1.0.8_orig\raptor\src\raptor_general.c Sat Apr 26 01:20:08 2008 +++ C:\builds\redland-1.0.8_good\raptor\src\raptor_general.c Thu Jul 31 11:03:35 2008 @@ -229,7 +229,13 @@ len=vsnprintf(buffer, size, message, args_copy); va_end(args_copy); - if(len>=0) + /*on windows, vsnprintf returns -1 unless the buffer fits. + If the buffer exactly fits the string without a null terminator, + it returns the string length and we end up with an unterminated + string. I added a check to make sure the string gets terminated. + if (len>=0) + */ + if ((len>=0) && (buffer[len] == '\0') ) break; RAPTOR_FREE(cstring, buffer); size+=4;