Skip to content

Commit

Permalink
Propagate EINVAL properly
Browse files Browse the repository at this point in the history
  • Loading branch information
freddy77 committed Mar 2, 2014
1 parent 2ebebe7 commit e626f06
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tds/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e626f06

Please sign in to comment.