Hello all,

On Mon, 12 Jan 2009 22:55:32 +0100 Andreas 'ads' Scherbaum wrote:

> I tracked the problem done to the function str_numth() in
> src/backend/utils/adt/formatting.c. The fix (attached) is easy: i
> stole the function code from the latest 8.0 version which looks fare
> more sane in handling the string pointers.

Now with the correct patch attached, thanks to anyone who pointed this
out ;-)


Kind regards

-- 
                                Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
diff -rc postgresql-7.4.23.orig/src/backend/utils/adt/formatting.c postgresql-7.4.23.patch/src/backend/utils/adt/formatting.c
*** postgresql-7.4.23.orig/src/backend/utils/adt/formatting.c	2007-06-29 03:52:14.000000000 +0200
--- postgresql-7.4.23.patch/src/backend/utils/adt/formatting.c	2009-01-12 22:39:47.000000000 +0100
***************
*** 1444,1450 ****
  static char *
  str_numth(char *dest, char *num, int type)
  {
! 	sprintf(dest, "%s%s", num, get_th(num, type));
  	return dest;
  }
  
--- 1444,1452 ----
  static char *
  str_numth(char *dest, char *num, int type)
  {
! 	if (dest != num)
! 		strcpy(dest, num);
! 	strcat(dest, get_th(num, type));
  	return dest;
  }
  
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to