summaryrefslogtreecommitdiff
path: root/src/backend/utils/mb/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/mb/common.c')
-rw-r--r--src/backend/utils/mb/common.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/utils/mb/common.c b/src/backend/utils/mb/common.c
index b6bcae3b156..6d90c734454 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.3 1998/10/06 03:02:21 momjian Exp $ */
+ * $Id: common.c,v 1.4 1999/05/13 10:28:25 ishii Exp $ */
#include <stdlib.h>
@@ -28,6 +28,10 @@ pg_char_to_encoding(const char *s)
{
pg_encoding_conv_tbl *p = pg_conv_tbl;
+ if (!s) {
+ return (-1);
+ }
+
for (; p->encoding >= 0; p++)
{
if (!strcasecmp(s, p->name))