1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00
Files
postgres/src/backend/utils/adt/version.c
Thomas G. Lockhart d1c1301039 Version string was truncating the last character.
Use memcpy() rather than StrNCpy() which had forced a string termination
 character at the end.
1999-04-06 15:35:36 +00:00

32 lines
624 B
C

/*-------------------------------------------------------------------------
*
* version.c
* Returns the version string
*
* IDENTIFICATION
*
* $Header: /cvsroot/pgsql/src/backend/utils/adt/version.c,v 1.6 1999/04/06 15:35:36 thomas Exp $
*
*-------------------------------------------------------------------------
*/
#include <string.h>
#include "postgres.h"
#include "version.h"
text *version(void);
text *
version(void)
{
int n = strlen(PG_VERSION_STR) + VARHDRSZ;
text *ret = (text *) palloc(n);
VARSIZE(ret) = n;
memcpy(VARDATA(ret), PG_VERSION_STR, strlen(PG_VERSION_STR));
return ret;
}