summaryrefslogtreecommitdiff
path: root/src/backend/utils/mb/common.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-04-16 02:42:01 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-04-16 02:42:01 +0000
commitfbee97664e89b71b91f9185b9f4b114c465b0c69 (patch)
tree1ca77202af27a03c13a0484d051eccd88dabceae /src/backend/utils/mb/common.c
parent6ccb2af7251a203d196d973f2d0135e3e4e7b452 (diff)
getdatabaseencoding() and PG_encoding_to_char() were being sloppy about
converting char* strings to type 'name'. Imagine my surprise when 7.1 release coredumped upon start when compiled --enable-multibyte ...
Diffstat (limited to 'src/backend/utils/mb/common.c')
-rw-r--r--src/backend/utils/mb/common.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/utils/mb/common.c b/src/backend/utils/mb/common.c
index 1b3fe5fcf94..9c75b6c919e 100644
--- a/src/backend/utils/mb/common.c
+++ b/src/backend/utils/mb/common.c
@@ -2,7 +2,7 @@
* This file contains some public functions
* usable for both the backend and the frontend.
* Tatsuo Ishii
- * $Id: common.c,v 1.12 2001/02/11 01:59:22 ishii Exp $
+ * $Id: common.c,v 1.13 2001/04/16 02:42:01 tgl Exp $
*/
#include "postgres.h"
@@ -91,8 +91,9 @@ Datum
PG_encoding_to_char(PG_FUNCTION_ARGS)
{
int32 encoding = PG_GETARG_INT32(0);
+ const char *encoding_name = pg_encoding_to_char(encoding);
- PG_RETURN_NAME(pg_encoding_to_char(encoding));
+ return DirectFunctionCall1(namein, CStringGetDatum(encoding_name));
}
#endif