Re: [HACKERS] Oops in snprintf.c

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: taral(at)mail(dot)utexas(dot)edu (Taral)
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Oops in snprintf.c
Date: 1998-10-08 00:35:15
Message-ID: 199810080035.UAA16240@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[Charset iso-8859-1 unsupported, filtering to ASCII...]
> I think I mentioned this before, but no-one fixed it... The variable 'value'
> is being assigned a long_long when %ll is being used, but value is only a
> 'long'... Don'tcha wish there were type-checking for va_arg?
>
> Enjoy.
>
> Taral
>
> *** ./backend/port/snprintf.c.orig Wed Oct 7 17:15:04 1998
> --- ./backend/port/snprintf.c Wed Oct 7 17:16:07 1998
> ***************
> *** 130,136 ****
> --- 130,140 ----
> dopr(char *buffer, const char *format,...)
> {
> int ch;
> + #ifdef HAVE_LONG_INT_64
> + long_long value;
> + #else
> long value;
> + #endif
> int longflag = 0;
> int longlongflag = 0;
> int pointflag = 0;
>
>
>

It is more compilcated than that. You have to fix fmtnum too. I have
applied a patch. Let me know how it works.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-10-08 00:40:39 Re: [PATCHES] Missing file from JDBC Driver
Previous Message Bruce Momjian 1998-10-08 00:23:50 Re: [HACKERS] NT port of PGSQL - success