Created
November 13, 2017 01:35
-
-
Save rundel/e64e184f0d2fcceaf14ef011b3432a07 to your computer and use it in GitHub Desktop.
Patch for libspatialite to support lwgeom >= 2.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/gaiageo/gg_lwgeom.c b/src/gaiageo/gg_lwgeom.c | |
index 0ae8e71..328a5bc 100644 | |
--- a/src/gaiageo/gg_lwgeom.c | |
+++ b/src/gaiageo/gg_lwgeom.c | |
@@ -90,29 +90,29 @@ splite_lwgeom_version (void) | |
static void | |
lwgaia_noticereporter (const char *fmt, va_list ap) | |
{ | |
- char *msg; | |
- if (!lw_vasprintf (&msg, fmt, ap)) | |
+ char *msg = sqlite3_vmprintf (fmt, ap); | |
+ if (msg == NULL) | |
{ | |
- va_end (ap); | |
- return; | |
+ va_end (ap); | |
+ return; | |
} | |
spatialite_e ("LWGEOM notice: %s\n", msg); | |
gaiaSetLwGeomWarningMsg (msg); | |
- free (msg); | |
+ sqlite3_free (msg); | |
} | |
static void | |
lwgaia_errorreporter (const char *fmt, va_list ap) | |
{ | |
- char *msg; | |
- if (!lw_vasprintf (&msg, fmt, ap)) | |
+ char *msg = sqlite3_vmprintf (fmt, ap); | |
+ if (msg == NULL) | |
{ | |
- va_end (ap); | |
- return; | |
+ va_end (ap); | |
+ return; | |
} | |
spatialite_e ("LWGEOM error: %s\n", msg); | |
gaiaSetLwGeomErrorMsg (msg); | |
- free (msg); | |
+ sqlite3_free (msg); | |
} | |
#ifndef POSTGIS_2_1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment