Permalink
Browse files

Check read errors getting data for varchar/varbinary(max)

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
  • Loading branch information...
1 parent a92ed31 commit 1b4cafef8571b5eead550144b2e88a26f8109780 @freddy77 freddy77 committed Feb 15, 2014
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/tds/data.c
View
@@ -305,8 +305,9 @@ tds_varmax_stream_read(TDSINSTREAM *stream, void *ptr, size_t len)
if (len > s->chunk_left)
len = s->chunk_left;
s->chunk_left -= len;
- tds_get_n(s->tds, ptr, len);
- return len;
+ if (tds_get_n(s->tds, ptr, len))
+ return len;
+ return -1;
}
static TDSRET

0 comments on commit 1b4cafe

Please sign in to comment.