[geos-commits] [SCM] GEOS branch master updated. 3468fffcf0550d9c5d77ad0a762e329ff5ea30be

git at osgeo.org git at osgeo.org
Fri Feb 26 11:12:00 PST 2021


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 "GEOS".

The branch, master has been updated
       via  3468fffcf0550d9c5d77ad0a762e329ff5ea30be (commit)
      from  8a5d8bac9efde79ef983e0e49683fb16a291ac2c (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 3468fffcf0550d9c5d77ad0a762e329ff5ea30be
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Fri Feb 26 11:11:30 2021 -0800

    Fix geosop formatNum function

diff --git a/util/geosop/GeosOp.cpp b/util/geosop/GeosOp.cpp
index 2cd4844..144b5fe 100644
--- a/util/geosop/GeosOp.cpp
+++ b/util/geosop/GeosOp.cpp
@@ -146,9 +146,10 @@ GeosOp::~GeosOp() {
 std::string formatNum(long n)
 {
     auto fmt = std::to_string(n);
-    size_t insertPosition = fmt.length() - 3;
+    // use signed num to allow negative to indicate done
+    int insertPosition = ((int) fmt.length()) - 3;
     while (insertPosition > 0) {
-        fmt.insert(insertPosition, ",");
+        fmt.insert( (size_t) insertPosition, ",");
         insertPosition-=3;
     }
     return fmt ;

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

Summary of changes:
 util/geosop/GeosOp.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list