Skip to Content.
Sympa Menu

freetds - RE: Losing last character of TEXT fields

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Brian Bruns" <camber AT ais.org>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: RE: Losing last character of TEXT fields
  • Date: Tue, 9 Jul 2002 11:47:01 -0400


It think the root cause may be deeper. Why is a short destlen being asked
for? This may have something to do with the return value of dbdatlen() or
similar calls... ie the application code may be:

mylen = dbdatlen(dbproc, colnum);
mybuf = malloc(mylen);
dbconvert(dbproc,..., mybuf, mylen);

So by fixing dbdatlen() or whichever it turns out to be, we may get an
extra char *and* no buffer problem.

Brian

> I think you're right, Frediano; the code is still broken.
>
> We shouldn't null-terminate unless destlen is -1. If the destination buffer
> is too small, we should call the error handler and return -1. So say the
> docs. Eric?
>
> --jkl




Archive powered by MHonArc 2.6.24.

Top of Page