1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Rename strNcpy to StrNCpy, and change third parameter.

This commit is contained in:
Bruce Momjian
1997-10-25 01:10:58 +00:00
parent 8b53f6e5b6
commit f3af1368bd
31 changed files with 87 additions and 83 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.15 1997/09/08 21:43:41 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.16 1997/10/25 01:09:16 momjian Exp $
*
* NOTES
* This should be moved to a more appropriate place. It is here
@@ -269,7 +269,7 @@ lo_import(text *filename)
/*
* open the file to be read in
*/
strNcpy(fnamebuf, VARDATA(filename), VARSIZE(filename) - VARHDRSZ);
StrNCpy(fnamebuf, VARDATA(filename), VARSIZE(filename) - VARHDRSZ + 1);
fd = open(fnamebuf, O_RDONLY, 0666);
if (fd < 0)
{ /* error */
@@ -343,7 +343,7 @@ lo_export(Oid lobjId, text *filename)
* open the file to be written to
*/
oumask = umask((mode_t) 0);
strNcpy(fnamebuf, VARDATA(filename), VARSIZE(filename) - VARHDRSZ);
StrNCpy(fnamebuf, VARDATA(filename), VARSIZE(filename) - VARHDRSZ + 1);
fd = open(fnamebuf, O_CREAT | O_WRONLY, 0666);
umask(oumask);
if (fd < 0)

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.7 1997/09/08 21:43:43 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.8 1997/10/25 01:09:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -241,7 +241,7 @@ strmake(char *str, int len)
len = strlen(str);
newstr = (char *) palloc((unsigned) len + 1);
strNcpy(newstr, str, len);
StrNCpy(newstr, str, len+1);
newstr[len] = (char) 0;
return newstr;
}

View File

@@ -90,7 +90,7 @@ verify_password(char *user, char *password, Port *port,
if (test_pw[strlen(test_pw) - 1] == '\n')
test_pw[strlen(test_pw) - 1] = '\0';
strNcpy(salt, test_pw, 2);
StrNCpy(salt, test_pw, 3);
if (strcmp(user, test_user) == 0)
{

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.9 1997/09/08 21:43:47 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.10 1997/10/25 01:09:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -154,7 +154,7 @@ PQpnames(char **pnames, int rule_p)
{
if (!rule_p || portals[i]->portal->rule_p)
{
strncpy(pnames[cur_pname], portals[i]->name, PortalNameLength);
strncpy(pnames[cur_pname], portals[i]->name, PortalNameLength+1);
++cur_pname;
}
}
@@ -730,7 +730,7 @@ PQappendNotify(char *relname, int pid)
pqNotifyList = DLNewList();
p = (PQNotifyList *) pbuf_alloc(sizeof(PQNotifyList));
strNcpy(p->relname, relname, NAMEDATALEN - 1);
StrNCpy(p->relname, relname, NAMEDATALEN);
p->be_pid = pid;
p->valid = 1;
DLAddTail(pqNotifyList, DLNewElem(p));

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.7 1997/09/08 21:43:48 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.8 1997/10/25 01:09:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -384,7 +384,7 @@ void
pbuf_setportalinfo(PortalEntry *entry, char *pname)
{
if (entry)
strNcpy(entry->name, pname, PortalNameLength - 1);
StrNCpy(entry->name, pname, PortalNameLength);
}
/* --------------------------------