From 7625bfaebfc972692b453d26f7c80d5e5fd01ebb Mon Sep 17 00:00:00 2001 From: Evan Miller Date: Thu, 26 Dec 2024 06:33:37 -0500 Subject: [PATCH] Build fixes --- configure.ac | 2 +- src/odbc/odbc.c | 2 +- src/util/mdb-sql.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 1383545..176f14d 100644 --- a/configure.ac +++ b/configure.ac @@ -83,7 +83,7 @@ AM_CONDITIONAL(SQL, test x$sql = xtrue) AC_SUBST(SQL) AC_SUBST(LFLAGS) -CFLAGS="$CFLAGS -Wall -Werror" +CFLAGS="$CFLAGS -Wall" LOCALE_T=locale_t AS_CASE([$host], [*mingw*], [LDFLAGS="$LDFLAGS -no-undefined" CFLAGS="$CFLAGS -D_spawnv=spawnv"], []) diff --git a/src/odbc/odbc.c b/src/odbc/odbc.c index 1acb77d..a9426a1 100644 --- a/src/odbc/odbc.c +++ b/src/odbc/odbc.c @@ -2058,7 +2058,7 @@ static int _odbc_fix_literals(struct _hstmt *stmt) char tmp[4096]; char *s, *d, *p; int i, quoted = 0, find_end = 0; - char quote_char; + char quote_char = '\0'; s=stmt->query; d=tmp; diff --git a/src/util/mdb-sql.c b/src/util/mdb-sql.c index fa087a6..0e9b146 100644 --- a/src/util/mdb-sql.c +++ b/src/util/mdb-sql.c @@ -322,7 +322,7 @@ main(int argc, char **argv) char prompt[20]; int line = 0; char *mybuf; - unsigned int bufsz; + size_t bufsz; MdbSQL *sql; FILE *in = NULL, *out = NULL; char *filename_in=NULL, *filename_out=NULL; @@ -408,7 +408,7 @@ main(int argc, char **argv) /* give the buffer an initial size */ bufsz = 4096; - mybuf = g_malloc(bufsz); + mybuf = malloc(bufsz); mybuf[0]='\0'; while (1) { @@ -420,7 +420,7 @@ main(int argc, char **argv) if (in) { s=calloc(bufsz, 1); - if (!fgets(s, bufsz, in)) { + if (!fgets(s, (int)bufsz, in)) { // Backwards compatibility with older MDBTools // Files read from the command line had an // implicit "go" at the end @@ -478,7 +478,7 @@ main(int argc, char **argv) while (strlen(mybuf) + strlen(s) > bufsz) { bufsz *= 2; - mybuf = (char *) g_realloc(mybuf, bufsz); + mybuf = realloc(mybuf, bufsz); } #ifdef HAVE_READLINE_HISTORY /* don't record blank lines, or lines read from files @@ -500,7 +500,7 @@ main(int argc, char **argv) } mdb_sql_exit(sql); - g_free(mybuf); + free(mybuf); if (s) free(s); if (out) fclose(out); if ((in) && (in != stdin)) fclose(in);