From 3e873022014d5359f4698dc85a7708fb869a09fe Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sat, 29 Aug 1998 02:09:27 +0000 Subject: libpq's pqGetnchar() should not return a null-terminated value anymore. Fix for large objects. --- src/interfaces/libpq/fe-misc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/interfaces/libpq/fe-misc.c') diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 5608a0de2f..baa0d7feed 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -24,7 +24,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.18 1998/08/17 03:50:38 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.19 1998/08/29 02:09:25 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -160,8 +160,7 @@ pqPuts(const char *s, PGconn *conn) /* --------------------------------------------------------------------- */ /* pqGetnchar: - get a string of exactly len bytes in buffer s (which must be 1 byte - longer) and terminate it with a '\0'. + get a string of exactly len bytes in buffer s, no null termination */ int pqGetnchar(char *s, int len, PGconn *conn) @@ -170,8 +169,8 @@ pqGetnchar(char *s, int len, PGconn *conn) return EOF; memcpy(s, conn->inBuffer + conn->inCursor, len); - s[len] = '\0'; - + /* no terminating null */ + conn->inCursor += len; if (conn->Pfdebug) -- cgit v1.2.1