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

Fix pgproc names over 15 chars in output. Add strNcpy() function. remove some (void) casts that are unnecessary.

This commit is contained in:
Bruce Momjian
1997-08-12 20:16:25 +00:00
parent 4b851b1cfc
commit edb58721b8
44 changed files with 163 additions and 192 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.10 1997/06/10 13:01:32 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.11 1997/08/12 20:15:18 momjian Exp $
*
* NOTES
* This should be moved to a more appropriate place. It is here
@@ -257,8 +257,7 @@ lo_import(text *filename)
/*
* open the file to be read in
*/
strncpy(fnamebuf, VARDATA(filename), VARSIZE(filename) - VARHDRSZ);
fnamebuf[VARSIZE(filename) - VARHDRSZ] = '\0';
strNcpy(fnamebuf, VARDATA(filename), VARSIZE(filename) - VARHDRSZ);
fd = open(fnamebuf, O_RDONLY, 0666);
if (fd < 0) { /* error */
elog(WARN, "be_lo_import: can't open unix file\"%s\"\n",
@@ -325,8 +324,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);
fnamebuf[VARSIZE(filename) - VARHDRSZ] = '\0';
strNcpy(fnamebuf, VARDATA(filename), VARSIZE(filename) - VARHDRSZ);
fd = open(fnamebuf, O_CREAT|O_WRONLY, 0666);
(void) umask(oumask);
if (fd < 0) { /* error */