From: Tom Lane Date: Sun, 24 Jan 1999 02:47:15 +0000 (+0000) Subject: Fix a couple little problems with signed vs. unsigned X-Git-Tag: REL6_5~771 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=77f54282441584f539186d1e9054544f89e0e9b4;p=postgresql Fix a couple little problems with signed vs. unsigned characters ... --- diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 386643fe95..2fef28b66c 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -5,7 +5,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pqcomm.c,v 1.64 1999/01/23 22:27:28 tgl Exp $ + * $Id: pqcomm.c,v 1.65 1999/01/24 02:47:15 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -83,8 +83,8 @@ extern FILE * debug_port; /* in util.c */ /* * Buffers */ -char PqSendBuffer[PQ_BUFFER_SIZE]; -char PqRecvBuffer[PQ_BUFFER_SIZE]; +unsigned char PqSendBuffer[PQ_BUFFER_SIZE]; +unsigned char PqRecvBuffer[PQ_BUFFER_SIZE]; int PqSendPointer,PqRecvPointer,PqRecvLength; @@ -173,8 +173,8 @@ pq_close() int pq_flush() { - char *bufptr = PqSendBuffer; - char *bufend = PqSendBuffer + PqSendPointer; + unsigned char *bufptr = PqSendBuffer; + unsigned char *bufend = PqSendBuffer + PqSendPointer; while (bufptr < bufend) { @@ -725,7 +725,7 @@ pq_putncharlen(char *s, int n) * Act like the stdio putc() function. Write one character * to the stream. Return this character, or EOF on error. */ -int pq_putchar(char c) +int pq_putchar(unsigned char c) { if (PqSendPointer >= PQ_BUFFER_SIZE) if (pq_flush()) /* If buffer is full, then flush it out */ diff --git a/src/include/libpq/libpq.h b/src/include/libpq/libpq.h index c1cdd8ac5d..cd036ca67f 100644 --- a/src/include/libpq/libpq.h +++ b/src/include/libpq/libpq.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: libpq.h,v 1.24 1999/01/23 22:27:25 tgl Exp $ + * $Id: libpq.h,v 1.25 1999/01/24 02:47:15 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -263,7 +263,7 @@ extern int pq_getchar(void); extern int pq_peekchar(void); extern int pq_getnchar(char *s, int off, int maxlen); extern int pq_getint(int b); -extern int pq_putchar(char c); +extern int pq_putchar(unsigned char c); extern void pq_putstr(char *s); extern void pq_putnchar(char *s, int n); extern void pq_putint(int i, int b); @@ -291,9 +291,9 @@ extern void StreamClose(int sock); #define PQ_BUFFER_SIZE 8192 -extern char PqSendBuffer[PQ_BUFFER_SIZE]; +extern unsigned char PqSendBuffer[PQ_BUFFER_SIZE]; extern int PqSendPointer; /* Next index to store a byte in PqSendBuffer */ -extern char PqRecvBuffer[PQ_BUFFER_SIZE]; +extern unsigned char PqRecvBuffer[PQ_BUFFER_SIZE]; extern int PqRecvPointer; /* Next index to read a byte from PqRecvBuffer */ extern int PqRecvLength; /* End of data available in PqRecvBuffer */