freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- 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
-
Possible endian issue,
Kevin Lyons, 09/24/1999
- <Possible follow-up(s)>
- Re: Possible endian issue, Brian Bruns, 09/24/1999
- Re: Possible endian issue, Kevin Lyons, 09/26/1999
Archive powered by MHonArc 2.6.24.