Commit 83fea34b authored by Tom Lane's avatar Tom Lane

Fix unportable isdigit() call --- must cast arg to unsigned char.

parent 8a7025f0
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
* formatting.c * formatting.c
* *
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.81 2004/11/01 14:33:10 momjian Exp $ * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.82 2004/11/20 02:09:47 tgl Exp $
* *
* *
* Portions Copyright (c) 1999-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1999-2004, PostgreSQL Global Development Group
...@@ -3786,14 +3786,14 @@ NUM_numpart_from_char(NUMProc *Np, int id, int plen) ...@@ -3786,14 +3786,14 @@ NUM_numpart_from_char(NUMProc *Np, int id, int plen)
if (*Np->number == ' ' && Np->read_pre + Np->read_post > 0) if (*Np->number == ' ' && Np->read_pre + Np->read_post > 0)
{ {
/* /*
* locale sign (NUM_S) is always anchored behind a last number, if: * locale sign (NUM_S) is always anchored behind a last number, if:
* - locale sign expected * - locale sign expected
* - last read char was NUM_0/9 or NUM_DEC * - last read char was NUM_0/9 or NUM_DEC
* - and next char is not digit * - and next char is not digit
*/ */
if (IS_LSIGN(Np->Num) && isread && if (IS_LSIGN(Np->Num) && isread &&
(Np->inout_p+1) <= Np->inout + plen && (Np->inout_p+1) <= Np->inout + plen &&
isdigit(*(Np->inout_p+1))==0) !isdigit((unsigned char) *(Np->inout_p+1)))
{ {
int x; int x;
char *tmp = Np->inout_p++; char *tmp = Np->inout_p++;
......
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