Skip to content
Browse files

Do not hide error using --enable-extra-checks

It seems that reducing buffers to catch more errors has the effect of
hiding a lot of problems.
So it's better to not alter too much behaviour if this flag is turned on.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
  • Loading branch information...
1 parent f6b860a commit 4abcaf518375106c2925bec06b84573b5a91bfe9 @freddy77 freddy77 committed Mar 2, 2014
Showing with 1 addition and 5 deletions.
  1. +1 −5 src/tds/stream.c
View
6 src/tds/stream.c
@@ -48,7 +48,7 @@
/** \cond HIDDEN_SYMBOLS */
#if ENABLE_EXTRA_CHECKS
-# define TEMP_INIT(s) char* temp = (char*)malloc(32); const size_t temp_size = 32
+# define TEMP_INIT(s) const size_t temp_size = s; char* temp = (char*)malloc(temp_size)
# define TEMP_FREE free(temp);
# define TEMP_SIZE temp_size
#else
@@ -321,11 +321,7 @@ tds_dynamic_stream_write(TDSOUTSTREAM *stream, size_t len)
TDSRET
tds_dynamic_stream_init(TDSDYNAMICSTREAM * stream, void **ptr, size_t allocated)
{
-#if ENABLE_EXTRA_CHECKS
- const size_t initial_size = 16;
-#else
const size_t initial_size = 1024;
-#endif
stream->stream.write = tds_dynamic_stream_write;
stream->buf = ptr;

0 comments on commit 4abcaf5

Please sign in to comment.
Something went wrong with that request. Please try again.