From: D'Arcy J.M. Cain Date: Sun, 27 May 2001 19:06:20 +0000 (+0000) Subject: Changed use of macros for extracting information. According to comments X-Git-Tag: REL7_2_BETA1~1177 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2bc1c14ab0d68dc7dc2c8f426e10540836e4f41e;p=postgresql Changed use of macros for extracting information. According to comments in c.h we should be using the visible structure. We should only see de-TOASTed values in this program. The old method refused to compile because the length macro was no longer an lvalue. --- diff --git a/contrib/chkpass/chkpass.c b/contrib/chkpass/chkpass.c index 46080cc07a..46914f40a2 100644 --- a/contrib/chkpass/chkpass.c +++ b/contrib/chkpass/chkpass.c @@ -4,7 +4,7 @@ * darcy@druid.net * http://www.druid.net/darcy/ * - * $Header: /cvsroot/pgsql/contrib/chkpass/chkpass.c,v 1.1 2001/05/03 12:32:13 darcy Exp $ + * $Header: /cvsroot/pgsql/contrib/chkpass/chkpass.c,v 1.2 2001/05/27 19:06:20 darcy Exp $ * best viewed with tabs set to 4 */ @@ -135,8 +135,8 @@ chkpass_rout(chkpass *password) if ((result = (text *) palloc(VARHDRSZ + 16)) != NULL) { - VARSIZE(result) = VARHDRSZ + strlen(password->password); - memcpy(VARDATA(result), password->password, strlen(password->password)); + result->vl_len = VARHDRSZ + strlen(password->password); + memcpy(result->vl_dat, password->password, strlen(password->pass } return (result);