@@ -249,8 +249,8 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
249249 avail = dbc -> alen - dbc -> apos ;
250250 have = size * nmemb ;
251251
252- DBGH (dbc , "libcurl: new data chunk of size [%zd ] x %zd arrived; "
253- "available buffer: %zd/%zd ." , nmemb , size , avail , dbc -> alen );
252+ DBGH (dbc , "libcurl: new data chunk of size [%zu ] x %zu arrived; "
253+ "available buffer: %zu/%zu ." , nmemb , size , avail , dbc -> alen );
254254
255255 /* do I need to grow the existing buffer? */
256256 if (avail < have ) {
@@ -260,14 +260,14 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
260260 while (need < dbc -> apos + have ) {
261261 need *= 2 ;
262262 }
263- DBGH (dbc , "libcurl: need to grow buffer for new chunk of %zd "
264- "from %zd to %zd bytes." , have , dbc -> alen , need );
263+ DBGH (dbc , "libcurl: need to grow buffer for new chunk of %zu "
264+ "from %zu to %zu bytes." , have , dbc -> alen , need );
265265 if (dbc -> amax && (dbc -> amax < need )) { /* do I need more than max? */
266266 if (dbc -> amax <= (size_t )dbc -> alen ) { /* am I at max already? */
267267 goto too_large ;
268268 } else { /* am not: alloc max possible (if that's enough) */
269269 need = dbc -> amax ;
270- WARNH (dbc , "libcurl: capped buffer to max: %zd " , need );
270+ WARNH (dbc , "libcurl: capped buffer to max: %zu " , need );
271271 /* re'eval what I have available... */
272272 avail = dbc -> amax - dbc -> apos ;
273273 if (avail < have ) {
@@ -283,7 +283,7 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
283283 * the chunk right past the indicated JSON length.) */
284284 wbuf = realloc (dbc -> abuff , need + /*\0*/ 1 );
285285 if (! wbuf ) {
286- ERRNH (dbc , "libcurl: failed to realloc to %zdB ." , need );
286+ ERRNH (dbc , "libcurl: failed to realloc to %zuB ." , need );
287287 return 0 ;
288288 }
289289 dbc -> abuff = wbuf ;
@@ -294,7 +294,7 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
294294 dbc -> apos += have ;
295295 /* Add the 0-term for UJSON4C (but don't count it - see above) */
296296 dbc -> abuff [dbc -> apos ] = '\0' ;
297- DBGH (dbc , "libcurl: copied %zdB : `%.*s`." , have , have , ptr );
297+ DBGH (dbc , "libcurl: copied %zuB : `%.*s`." , have , have , ptr );
298298
299299 /*
300300 * "Your callback should return the number of bytes actually taken care
@@ -309,8 +309,8 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
309309 return have ;
310310
311311too_large :
312- ERRH (dbc , "libcurl: at %zd and can't grow past max %zd for new chunk of "
313- "%zd bytes." , dbc -> apos , dbc -> amax , have );
312+ ERRH (dbc , "libcurl: at %zu and can't grow past max %zu for new chunk of "
313+ "%zu bytes." , dbc -> apos , dbc -> amax , have );
314314 return 0 ;
315315}
316316
@@ -779,6 +779,7 @@ SQLRETURN curl_post(esodbc_stmt_st *stmt, int url_type,
779779 ESODBC_MUX_UNLOCK (& dbc -> curl_mux );
780780 return (url_type == ESODBC_CURL_QUERY ) ?
781781 attach_answer (stmt , & rsp_body , is_json ) :
782+ /* ESODBC_CURL_CLOSE */
782783 close_es_answ_handler (stmt , & rsp_body , is_json );
783784 } else {
784785 ERRH (stmt , "received 200 response code with empty body." );
@@ -1176,9 +1177,8 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
11761177 ipv6 ? "[" : "" , LWSTR (& attrs -> server ), ipv6 ? "]" : "" ,
11771178 LWSTR (& attrs -> port ));
11781179 if (cnt <= 0 ) {
1179- ERRNH (dbc , "failed to print SQL URL out of server: `" LWPDL "` [%zd], "
1180- "port: `" LWPDL "` [%zd]." , LWSTR (& attrs -> server ),
1181- LWSTR (& attrs -> port ));
1180+ ERRNH (dbc , "failed to print SQL URL out of server: `" LWPDL "`, "
1181+ "port: `" LWPDL "`." , LWSTR (& attrs -> server ), LWSTR (& attrs -> port ));
11821182 SET_HDIAG (dbc , SQL_STATE_HY000 , "printing server's SQL URL failed" , 0 );
11831183 goto err ;
11841184 } else {
@@ -1213,9 +1213,8 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
12131213 ipv6 ? "[" : "" , LWSTR (& attrs -> server ), ipv6 ? "]" : "" ,
12141214 LWSTR (& attrs -> port ));
12151215 if (cnt <= 0 ) {
1216- ERRNH (dbc , "failed to print root URL out of server: `" LWPDL "` [%zd],"
1217- " port: `" LWPDL "` [%zd]." , LWSTR (& attrs -> server ),
1218- LWSTR (& attrs -> port ));
1216+ ERRNH (dbc , "failed to print root URL out of server: `" LWPDL "`,"
1217+ " port: `" LWPDL "`." , LWSTR (& attrs -> server ), LWSTR (& attrs -> port ));
12191218 SET_HDIAG (dbc , SQL_STATE_HY000 , "printing server's URL failed" , 0 );
12201219 goto err ;
12211220 } else {
@@ -1234,16 +1233,16 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
12341233 */
12351234 if (attrs -> uid .cnt ) {
12361235 if (! wstr_to_utf8 (& attrs -> uid , & dbc -> uid )) {
1237- ERRH (dbc , "failed to convert username [%zd ] `" LWPDL "` to UTF8." ,
1236+ ERRH (dbc , "failed to convert username [%zu ] `" LWPDL "` to UTF8." ,
12381237 attrs -> uid .cnt , LWSTR (& attrs -> uid ));
12391238 SET_HDIAG (dbc , SQL_STATE_HY000 , "username UTF8 conversion "
12401239 "failed" , 0 );
12411240 goto err ;
12421241 }
12431242 if (attrs -> pwd .cnt ) {
12441243 if (! wstr_to_utf8 (& attrs -> pwd , & dbc -> pwd )) {
1245- ERRH (dbc , "failed to convert password [%zd] (-not shown-) to "
1246- "UTF8." , attrs -> pwd .cnt );
1244+ ERRH (dbc , "failed to convert password [%zu] `%s` to "
1245+ "UTF8." , attrs -> pwd .cnt , ESODBC_PWD_VAL_SUBST );
12471246 SET_HDIAG (dbc , SQL_STATE_HY000 , "password UTF8 "
12481247 "conversion failed" , 0 );
12491248 goto err ;
@@ -1296,7 +1295,7 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
12961295 WARNH (dbc , "no reply body limit set." );
12971296 }
12981297 }
1299- INFOH (dbc , "max body size: %zd ." , dbc -> amax );
1298+ INFOH (dbc , "max body size: %zu ." , dbc -> amax );
13001299
13011300 /*
13021301 * set max fetch size
@@ -1323,7 +1322,7 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
13231322 dbc -> fetch .slen = (char )attrs -> max_fetch_size .cnt ;
13241323 dbc -> fetch .str = malloc (dbc -> fetch .slen + /*\0*/ 1 );
13251324 if (! dbc -> fetch .str ) {
1326- ERRNH (dbc , "failed to alloc %zdB ." , dbc -> fetch .slen );
1325+ ERRNH (dbc , "failed to alloc %cB ." , dbc -> fetch .slen );
13271326 RET_HDIAGS (dbc , SQL_STATE_HY001 );
13281327 }
13291328 dbc -> fetch .str [dbc -> fetch .slen ] = 0 ;
@@ -1922,8 +1921,8 @@ static BOOL elastic_intervals_name2types(wstr_st *type_name,
19221921 break ;
19231922 }
19241923
1925- ERR ("unrecognized Elastic type `" LWPDL "` (%zd) ." , LWSTR ( type_name ) ,
1926- type_name -> cnt );
1924+ ERR ("unrecognized Elastic type: [%zu] `" LWPDL "`." , type_name -> cnt ,
1925+ LWSTR ( type_name ) );
19271926 return FALSE;
19281927}
19291928
@@ -2601,7 +2600,7 @@ static BOOL load_es_types(esodbc_dbc_st *dbc)
26012600 ERRH (stmt , "Elasticsearch returned no type as supported." );
26022601 goto end ;
26032602 } else if (ESODBC_MAX_NO_TYPES < row_cnt ) {
2604- ERRH (stmt , "Elasticsearch returned too many types (%d vs limit %zd )." ,
2603+ ERRH (stmt , "Elasticsearch returned too many types (%ld vs limit %d )." ,
26052604 row_cnt , ESODBC_MAX_NO_TYPES );
26062605 goto end ;
26072606 } else {
@@ -2617,7 +2616,7 @@ static BOOL load_es_types(esodbc_dbc_st *dbc)
26172616 /* indicate rowset size */
26182617 if (! SQL_SUCCEEDED (EsSQLSetStmtAttrW (stmt , SQL_ATTR_ROW_ARRAY_SIZE ,
26192618 (SQLPOINTER )ESODBC_MAX_NO_TYPES , 0 ))) {
2620- ERRH (stmt , "failed to set rowset size (%zd )." ,
2619+ ERRH (stmt , "failed to set rowset size (%d )." ,
26212620 ESODBC_MAX_NO_TYPES );
26222621 goto end ;
26232622 }
@@ -2916,7 +2915,7 @@ SQLRETURN EsSQLDriverConnectW
29162915 cnt += attrs .server .cnt + /*\0*/ 1 ;
29172916 dbc -> dsn .str = malloc (cnt * sizeof (SQLWCHAR )); /* alloc for both */
29182917 if (! dbc -> dsn .str ) {
2919- ERRNH (dbc , "OOM for %zdB ." , (orig_dsn .cnt + 1 ) * sizeof (SQLWCHAR ));
2918+ ERRNH (dbc , "OOM for %zuB ." , (orig_dsn .cnt + 1 ) * sizeof (SQLWCHAR ));
29202919 RET_HDIAGS (dbc , SQL_STATE_HY001 );
29212920 }
29222921 /* copy DSN */
0 commit comments