From 240fbc7184605050aea120ad837edd700b93587e Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Fri, 11 Sep 2020 21:45:58 +0200 Subject: [PATCH] Fix initializer type for MADB_ErrorList The initializer { 0, 0, 0, -1 } results in an error entry of, {SqlState = "\000\000\000\377\000", SqlStateV2 = "\000\000\000\000\000", SqlErrorMsg = '\000' , ReturnValue = 0} The reason is that integers are converted to char initializers in the SqlState char array and the remainder is set to 0. Instead, we should use compatible types so no implicit conversion occurs. With this, the entry becomes, {SqlState = "\000\000\000\000\000", SqlStateV2 = "\000\000\000\000\000", SqlErrorMsg = '\000' , ReturnValue = -1} --- ma_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ma_error.c b/ma_error.c index 328ebfef..d3f15666 100644 --- a/ma_error.c +++ b/ma_error.c @@ -144,7 +144,7 @@ MADB_ERROR MADB_ErrorList[] = { "S1000", "", "General error", SQL_ERROR}, { "S1107", "", "Row value out of range", SQL_ERROR}, { "S1C00", "", "Optional feature not implemented", SQL_ERROR}, - { 0,0,0, -1} + { "", "", "", -1} }; /* }}} */