44 * darcy@druid.net
55 * http://www.druid.net/darcy/
66 *
7- * $Id: chkpass.c,v 1.3 2001/05/28 15:34:27 darcy Exp $
7+ * $Id: chkpass.c,v 1.4 2001/05/30 02:11:46 darcy Exp $
88 * best viewed with tabs set to 4
99 */
1010
@@ -75,14 +75,14 @@ chkpass_in(PG_FUNCTION_ARGS)
7575 result = (chkpass * ) palloc (sizeof (chkpass ));
7676 strncpy (result -> password , str + 1 , 13 );
7777 result -> password [13 ] = 0 ;
78- return PointerGetDatum (result );
78+ PG_RETURN_POINTER (result );
7979 }
8080
8181 if (verify_pass (str ) != 0 )
8282 {
8383 elog (ERROR , "chkpass_in: purported CHKPASS \"%s\" is a weak password" ,
8484 str );
85- return PointerGetDatum (NULL );
85+ PG_RETURN_POINTER (NULL );
8686 }
8787
8888 result = (chkpass * ) palloc (sizeof (chkpass ));
@@ -98,7 +98,7 @@ chkpass_in(PG_FUNCTION_ARGS)
9898 mysalt [2 ] = 0 ; /* technically the terminator is not
9999 * necessary but I like to play safe */
100100 strcpy (result -> password , crypt (str , mysalt ));
101- return PointerGetDatum (result );
101+ PG_RETURN_POINTER (result );
102102}
103103
104104/*
@@ -114,7 +114,7 @@ chkpass_out(PG_FUNCTION_ARGS)
114114 char * result ;
115115
116116 if (password == NULL )
117- return PointerGetDatum (NULL );
117+ PG_RETURN_POINTER (NULL );
118118
119119 if ((result = (char * ) palloc (16 )) != NULL )
120120 {
@@ -138,7 +138,7 @@ chkpass_rout(PG_FUNCTION_ARGS)
138138 text * result = NULL ;
139139
140140 if (password == NULL )
141- return PointerGetDatum (NULL );
141+ PG_RETURN_POINTER (NULL );
142142
143143 if ((result = (text * ) palloc (VARHDRSZ + 16 )) != NULL )
144144 {
@@ -181,7 +181,7 @@ chkpass_ne(PG_FUNCTION_ARGS)
181181 char str [10 ];
182182 int sz = 8 ;
183183
184- if (!a1 || !a2 ) return 0 ;
184+ if (!a1 || !a2 ) PG_RETURN_BOOL ( 0 ) ;
185185 if (a2 -> vl_len < 12 ) sz = a2 -> vl_len - 4 ;
186186 strncpy (str , a2 -> vl_dat , sz );
187187 str [sz ] = 0 ;
0 commit comments