Commit 77f54282 authored by Tom Lane's avatar Tom Lane

Fix a couple little problems with signed vs. unsigned

characters ...
parent 17467bb7
......@@ -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 */
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment