index 5faeee745190575c8542414a68080d8785022738..ca59c183182bfd6e087dff502fcf409d44e6935a 100644 (file)
#include "postgres_fe.h"
+#include <ctype.h>
#include <limits.h>
#include <time.h>
#include "libpq-int.h"
#include "port/pg_bswap.h"
+
/* Enable tracing */
void
PQtrace(PGconn *conn, FILE *debug_port)
@@ -102,7 +104,7 @@ pqTraceOutputByte1(FILE *pfdebug, const char *data, int *cursor)
* Show non-printable data in hex format, including the terminating 0円
* that completes ErrorResponse and NoticeResponse messages.
*/
- if (!isprint(*v))
+ if (!isprint((unsigned char) *v))
fprintf(pfdebug, " \\x%02x", *v);
else
fprintf(pfdebug, " %c", *v);
@@ -186,7 +188,7 @@ pqTraceOutputNchar(FILE *pfdebug, int len, const char *data, int *cursor)
for (next = i = 0; i < len; ++i)
{
- if (isprint(v[i]))
+ if (isprint((unsigned char) v[i]))
continue;
else
{