Upstream GIT commits: 053f492441065052eb0d0caa16d355b6c452fd58 and e0cf74bbcd37ebe69f53cb84ddf2b21d614f53a6 merged Description: raptor_iostream write_bytes handlers are supposed to return the number of bytes written or 0 on failure Index: raptor-1.4.21/src/raptor_iostream.c =================================================================== --- raptor-1.4.21/src/raptor_iostream.c.orig 2010-01-29 15:54:42.000000000 -0800 +++ raptor-1.4.21/src/raptor_iostream.c 2010-03-02 20:21:29.000000000 -0800 @@ -195,7 +195,7 @@ raptor_sink_iostream_write_bytes(void *user_data, const void *ptr, size_t size, size_t nmemb) { - return 0; + return size*nmemb; /* success */ } static int @@ -257,8 +257,8 @@ raptor_filename_iostream_write_bytes(void *user_data, const void *ptr, size_t size, size_t nmemb) { - FILE* handle=(FILE*)user_data; - return (fwrite(ptr, size, nmemb, handle) == nmemb); + FILE* handle = (FILE*)user_data; + return (int)fwrite(ptr, size, nmemb, handle); } static void @@ -449,9 +449,11 @@ { struct raptor_write_string_iostream_context* con; - con=(struct raptor_write_string_iostream_context*)user_data; - return raptor_stringbuffer_append_counted_string(con->sb, - (const unsigned char*)ptr, size * nmemb, 1); + con = (struct raptor_write_string_iostream_context*)user_data; + if(raptor_stringbuffer_append_counted_string(con->sb, + (const unsigned char*)ptr, size * nmemb, 1)) + return 0; /* failure */ + return size * nmemb; /* success */ } static const raptor_iostream_handler2 raptor_iostream_write_string_handler={