]> granicus.if.org Git - postgresql/commitdiff
Changed use of macros for extracting information. According to comments
authorD'Arcy J.M. Cain <darcy@druid.net>
Sun, 27 May 2001 19:06:20 +0000 (19:06 +0000)
committerD'Arcy J.M. Cain <darcy@druid.net>
Sun, 27 May 2001 19:06:20 +0000 (19:06 +0000)
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.

contrib/chkpass/chkpass.c

index 46080cc07ad4c2d55b0fa98b95825bcb5b205e4d..46914f40a26061a628cdcd1f970144bdfbbb31a6 100644 (file)
@@ -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);