freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Lowden, James K" <LowdenJK AT bernstein.com>
- To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
- Subject: RE: Losing last character of TEXT fields
- Date: Tue, 9 Jul 2002 12:52:04 -0400
> > 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?
> From: Brian Bruns [mailto:camber AT ais.org]
> Sent: July 9, 2002 11:47 AM
>
> 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.
I see your point. I was thinking more of user conversions, via dbconvert()
or whatever. This should work, and doesn't:
int i = 1;
char c;
erc = dbconvert (dbproc, SYBINT4, &i, 0, SYBCHAR, &c, 1);
But there may well be a deeper issue within tdslib.
--jkl
-
RE: Losing last character of TEXT fields
, (continued)
- RE: Losing last character of TEXT fields, Lowden, James K, 07/08/2002
- RE: Losing last character of TEXT fields, Eric Deutsch, 07/08/2002
- RE: Losing last character of TEXT fields, Brian Bruns, 07/08/2002
- RE: Losing last character of TEXT fields, Lowden, James K, 07/08/2002
- RE: Losing last character of TEXT fields, James K. Lowden, 07/08/2002
- RE: Losing last character of TEXT fields, ZIGLIO Frediano, 07/09/2002
- RE: Losing last character of TEXT fields, Bill Thompson, 07/09/2002
- RE: Losing last character of TEXT fields, Lowden, James K, 07/09/2002
- RE: Losing last character of TEXT fields, Bill Thompson, 07/09/2002
- RE: Losing last character of TEXT fields, Brian Bruns, 07/09/2002
- RE: Losing last character of TEXT fields, Lowden, James K, 07/09/2002
- RE: Losing last character of TEXT fields, Eric Deutsch, 07/09/2002
- RE: Losing last character of TEXT fields, Brian Bruns, 07/09/2002
- RE: Losing last character of TEXT fields, Eric Deutsch, 07/09/2002
- RE: Losing last character of TEXT fields, Michael Peppler, 07/09/2002
- RE: Losing last character of TEXT fields, Lowden, James K, 07/09/2002
- RE: Losing last character of TEXT fields, Eric Deutsch, 07/09/2002
- RE: Losing last character of TEXT fields, Lowden, James K, 07/09/2002
- RE: Losing last character of TEXT fields, Eric Deutsch, 07/09/2002
- RE: Losing last character of TEXT fields, Brian Bruns, 07/09/2002
- RE: Losing last character of TEXT fields, ZIGLIO Frediano, 07/10/2002
Archive powered by MHonArc 2.6.24.