Skip to Content.
Sympa Menu

freetds - [freetds] tds_get_string

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: TDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] tds_get_string
  • Date: Sun, 30 Mar 2003 14:32:05 -0500

read.c::tds_get_string() contains what looks like a silly loop:

char temp[256];
char *p, *pend;
/* ... */
while (string_len > 0 && p < pend) {
in_left = string_len > (sizeof(temp) / 2) ?
(sizeof(temp) / 2) : string_len;
tds_get_n(tds, temp, in_left * 2);
p += tds7_unicode2ascii(tds, temp, in_left, p, pend - p);
string_len -= in_left;
}
return p - dest;

Basically, if the input string is more than 128 characters, we call
tds_get_n() and tds7_unicode2ascii() in 128-character chunks.

Why do we do this? I can't see any reason.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page