[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-1019-g8de4b9751

git at osgeo.org git at osgeo.org
Tue Jun 27 13:17:14 PDT 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  8de4b97514828c43b17225c1912ce2394a88cef4 (commit)
      from  20efe13b6c8e743cbb7b1cdebb7fad4e21b02324 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8de4b97514828c43b17225c1912ce2394a88cef4
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Jun 27 13:17:08 2023 -0700

    Do some twists to avoid warning on strncpy

diff --git a/loader/shp2pgsql-core.c b/loader/shp2pgsql-core.c
index c50be7591..c2d192af9 100644
--- a/loader/shp2pgsql-core.c
+++ b/loader/shp2pgsql-core.c
@@ -1174,13 +1174,8 @@ ShpLoaderOpenShape(SHPLOADERSTATE *state)
 		        ! strcmp(name, "ctid"))
 		{
 			char tmp_name[MAXFIELDNAMELEN];
-			size_t len = strlen(name);
-			if (len > (MAXFIELDNAMELEN - 2))
-			{
-				len = MAXFIELDNAMELEN - 2;
-			}
-			strncpy(tmp_name + 2, name, len);
-			tmp_name[len+1] = '\0';
+			strncpy(tmp_name + 2, name, MAXFIELDNAMELEN - 2);
+			tmp_name[strlen(name) + 1] = '\0';
 			tmp_name[0] = tmp_name[1] = '_';
 			strcpy(name, tmp_name);
 		}

-----------------------------------------------------------------------

Summary of changes:
 loader/shp2pgsql-core.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list