From cde53c4332f62c4d58f13e0d2e7dcf2e2b60ea88 Mon Sep 17 00:00:00 2001 From: Evan Miller Date: Wed, 5 Aug 2020 13:38:50 -0400 Subject: [PATCH] Respect octal flag in mdb-export brianb/mdbtools#153 The *col_val <= 0 check appears to have been intended to print ASCII characters as-is. But this is not a good check, and goes against the documented behavior. --- src/util/mdb-export.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/mdb-export.c b/src/util/mdb-export.c index 24748b6..58ac948 100755 --- a/src/util/mdb-export.c +++ b/src/util/mdb-export.c @@ -64,7 +64,7 @@ print_col(FILE *outfile, gchar *col_val, int quote_text, int col_type, int bin_l fprintf(outfile, "%s%s", escape_char, escape_char); col_val += orig_escape_len; #endif - } else if (is_binary_type(col_type) && *col_val <= 0 && bin_mode == MDB_BINEXPORT_OCTAL) + } else if (is_binary_type(col_type) && bin_mode == MDB_BINEXPORT_OCTAL) fprintf(outfile, "\\%03o", *(unsigned char*)col_val++); else putc(*col_val++, outfile);