We must cast the arguments of <ctype.h> functions to unsigned
char to avoid problems where char is signed.
Speaking of which, considering that this *is* a <ctype.h> function,
it's rather remarkable that we aren't seeing more complaints about
not having included that header.
Per buildfarm.
#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)
* 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);
for (next = i = 0; i < len; ++i)
{
- if (isprint(v[i]))
+ if (isprint((unsigned char) v[i]))
continue;
else
{