mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
Fix a misuse of 'char *' declaration.
This commit is contained in:
@@ -1403,7 +1403,7 @@ CC_lookup_pg_version(ConnectionClass *self)
|
|||||||
HSTMT hstmt;
|
HSTMT hstmt;
|
||||||
StatementClass *stmt;
|
StatementClass *stmt;
|
||||||
RETCODE result;
|
RETCODE result;
|
||||||
char *szVersion = "0.0";
|
char szVersion[32];
|
||||||
int major, minor;
|
int major, minor;
|
||||||
static char *func = "CC_lookup_pg_version";
|
static char *func = "CC_lookup_pg_version";
|
||||||
|
|
||||||
@@ -1439,6 +1439,7 @@ static char *func = "CC_lookup_pg_version";
|
|||||||
|
|
||||||
/* Extract the Major and Minor numbers from the string. */
|
/* Extract the Major and Minor numbers from the string. */
|
||||||
/* This assumes the string starts 'Postgresql X.X' */
|
/* This assumes the string starts 'Postgresql X.X' */
|
||||||
|
strcpy(szVersion, "0.0");
|
||||||
if (sscanf(self->pg_version, "%*s %d.%d", &major, &minor) >= 2) {
|
if (sscanf(self->pg_version, "%*s %d.%d", &major, &minor) >= 2) {
|
||||||
sprintf(szVersion, "%d.%d", major, minor);
|
sprintf(szVersion, "%d.%d", major, minor);
|
||||||
self->pg_version_major = major;
|
self->pg_version_major = major;
|
||||||
|
|||||||
Reference in New Issue
Block a user