Skip to Content.
Sympa Menu

freetds - Possible endian issue

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Kevin Lyons <kevin AT nol.org>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Possible endian issue
  • Date: Sat, 25 Sep 1999 12:18:01 -0500


Hey all, just goin' through the code from 0.47 and noticed something
that might
be an issue on the tds7_ascii2unicode function...correct me if I'm wrong
(it's been known
to happen quite a bit), but isn't the code only performing the
translation for little
endianess, not big? Shouldn't it be something more like...

char* tds7_ascii2unicode(const char *in_string, char *out_string, int
maxlen) {
int out_pos = 0;
int i;

for(i=0; in_string[i]; i++) {
#if defined(HW_LITTLE_ENDIAN)
out_string[out_pos++]=in_string[i];
out_string[out_pos++]='\0';
#elif defined(HW_BIG_ENDIAN)
out_string[out_pos++]='\0';
out_string[out_pos++]=in_string[i];
#else
#error Endianess not defined!
#endif
}
return out_string;
}


--
"To understand the mathmatics concept of infinity, one must only explore
the
depths of human stupidity" -- Voltaire

Kevin Lyons Programmer Nebrask@ Online Phone: 471-7870




Archive powered by MHonArc 2.6.24.

Top of Page