Skip to content

Instantly share code, notes, and snippets.

@msabramo
Created September 15, 2013 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msabramo/6574246 to your computer and use it in GitHub Desktop.
Save msabramo/6574246 to your computer and use it in GitHub Desktop.
This patch makes the iconv_fread test pass in FreeTDS
diff --git a/src/tds/stream.c b/src/tds/stream.c
index a008ebe..74e3268 100644
--- a/src/tds/stream.c
+++ b/src/tds/stream.c
@@ -205,11 +205,11 @@ TDSRET tds_dynamic_stream_init(TDSDYNAMICSTREAM * stream, void **ptr, size_t all
{
stream->stream.write = tds_dynamic_stream_write;
stream->buf = ptr;
- if (allocated < 1024) {
+ if (allocated < 4096) {
if (*ptr) free(*ptr);
- *ptr = malloc(1024);
+ *ptr = malloc(4096);
if (!*ptr) return TDS_FAIL;
- allocated = 1024;
+ allocated = 4096;
}
stream->allocated = allocated;
stream->size = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment