Skip to content

Instantly share code, notes, and snippets.

@tskenb
Created October 1, 2015 13:14
Show Gist options
  • Save tskenb/9ca5d50a680149d7d1c8 to your computer and use it in GitHub Desktop.
Save tskenb/9ca5d50a680149d7d1c8 to your computer and use it in GitHub Desktop.
Don't remove trailing spaces
diff --git a/src/tds_fdw.c b/src/tds_fdw.c
index 7976c3b..64b6a0c 100644
--- a/src/tds_fdw.c
+++ b/src/tds_fdw.c
@@ -989,7 +989,7 @@ char* tdsConvertToCString(DBPROCESS* dbproc, int srctype, const BYTE* src, DBINT
case SYBVARCHAR:
case SYBTEXT:
real_destlen = srclen + 1; /* the size of the array */
- destlen = -1; /* the size to pass to dbconvert (-1 means to null terminate it) */
+ destlen = -2; /* the size to pass to dbconvert (-2 means to null terminate it) */
desttype = SYBCHAR;
break;
case SYBBINARY:
@@ -1068,7 +1068,7 @@ char* tdsConvertToCString(DBPROCESS* dbproc, int srctype, const BYTE* src, DBINT
default:
real_destlen = 1000; /* Probably big enough */
- destlen = -1;
+ destlen = -2;
desttype = SYBCHAR;
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment