Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8d7952f

Browse files
committed
Further conversions to Version 1 API. Also, fix boolean return to use
PG_RETURN_BOOL(0) instead of return 0.
1 parentd34a5d8 commit8d7952f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎contrib/chkpass/chkpass.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
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-
returnPointerGetDatum(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-
returnPointerGetDatum(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-
returnPointerGetDatum(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-
returnPointerGetDatum(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-
returnPointerGetDatum(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
charstr[10];
182182
intsz=8;
183183

184-
if (!a1|| !a2)return0;
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

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp