Permalink
Browse files

Propagate EINVAL properly

  • Loading branch information...
1 parent 2ebebe7 commit e626f06a6a108a5a37023b9537a223675def4f57 @freddy77 freddy77 committed Feb 16, 2014
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/tds/stream.c
View
@@ -132,6 +132,10 @@ tds_convert_stream(TDSSOCKET * tds, TDSICONV * char_conv, TDS_ICONV_DIRECTION di
if (TDS_UNLIKELY(ib == temp)) { /* tds_iconv did not convert anything, avoid infinite loop */
tdsdump_log(TDS_DBG_NETWORK, "No conversion possible: some bytes left.\n");
+ res = TDS_FAIL;
+ if (conv_errno == EINVAL && tds)
+ tdserror(tds_get_ctx(tds), tds, TDSEICONVAVAIL, 0);
+ errno = conv_errno;
break;
}

0 comments on commit e626f06

Please sign in to comment.