Index: convert.c =================================================================== RCS file: /cvsroot/psqlodbc/psqlodbc/convert.c,v retrieving revision 1.166 diff -r1.166 convert.c 4789a4790,4791 > #define ISFIRSTOCTDIGIT(CH) ((CH) >= '0' && (CH) <= '3') > #define ISOCTDIGIT(CH) ((CH) >= '0' && (CH) <= '7') 4802c4804 < if (value[i] == BYTEA_ESCAPE_CHAR) --- > switch (value[i]) 4804,4805c4806,4837 < if (value[i + 1] == BYTEA_ESCAPE_CHAR) < { --- > case BYTEA_ESCAPE_CHAR: > i++; > if (value[i] == BYTEA_ESCAPE_CHAR) > if (rgbValue) > rgbValue[o] = value[i]; > > o++; > i++; > else > { > if ((ISFIRSTOCTDIGIT(value[i])) && > (ISOCTDIGIT(value[i + 1])) && > (ISOCTDIGIT(value[i + 2]))) > { > if (rgbValue) > rgbValue[o] = conv_from_octal(&value[i]); > > o++; > i += 3; > } > } > > /* > * Note: if we see '\' followed by something that isn't a > * recognized escape sequence, we loop around having done > * nothing except advance i. Therefore the something will be > * emitted as ordinary data on the next cycle. Corner case: > * '\' at end of string will just be discarded. > */ > break; > > default: 4808,4821c4840,4843 < i += 2; < } < else < { < if (rgbValue) < rgbValue[o] = conv_from_octal(&value[i]); < i += 4; < } < } < else < { < if (rgbValue) < rgbValue[o] = value[i]; < i++; --- > > i++; > o++ > break; 4823,4825d4844 < /** if (rgbValue) < mylog("convert_from_pgbinary: i=%d, rgbValue[%d] = %d, %c\n", i, o, rgbValue[o], rgbValue[o]); ***/ < o++;