@@ -233,8 +233,8 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
233233 avail = dbc -> alen - dbc -> apos ;
234234 have = size * nmemb ;
235235
236- DBGH (dbc , "libcurl: new data chunk of size [%zd ] x %zd arrived; "
237- "available buffer: %zd/%zd ." , nmemb , size , avail , dbc -> alen );
236+ DBGH (dbc , "libcurl: new data chunk of size [%zu ] x %zu arrived; "
237+ "available buffer: %zu/%zu ." , nmemb , size , avail , dbc -> alen );
238238
239239 /* do I need to grow the existing buffer? */
240240 if (avail < have ) {
@@ -244,14 +244,14 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
244244 while (need < dbc -> apos + have ) {
245245 need *= 2 ;
246246 }
247- DBGH (dbc , "libcurl: need to grow buffer for new chunk of %zd "
248- "from %zd to %zd bytes." , have , dbc -> alen , need );
247+ DBGH (dbc , "libcurl: need to grow buffer for new chunk of %zu "
248+ "from %zu to %zu bytes." , have , dbc -> alen , need );
249249 if (dbc -> amax && (dbc -> amax < need )) { /* do I need more than max? */
250250 if (dbc -> amax <= (size_t )dbc -> alen ) { /* am I at max already? */
251251 goto too_large ;
252252 } else { /* am not: alloc max possible (if that's enough) */
253253 need = dbc -> amax ;
254- WARNH (dbc , "libcurl: capped buffer to max: %zd " , need );
254+ WARNH (dbc , "libcurl: capped buffer to max: %zu " , need );
255255 /* re'eval what I have available... */
256256 avail = dbc -> amax - dbc -> apos ;
257257 if (avail < have ) {
@@ -267,7 +267,7 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
267267 * the chunk right past the indicated JSON length.) */
268268 wbuf = realloc (dbc -> abuff , need + /*\0*/ 1 );
269269 if (! wbuf ) {
270- ERRNH (dbc , "libcurl: failed to realloc to %zdB ." , need );
270+ ERRNH (dbc , "libcurl: failed to realloc to %zuB ." , need );
271271 return 0 ;
272272 }
273273 dbc -> abuff = wbuf ;
@@ -278,7 +278,7 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
278278 dbc -> apos += have ;
279279 /* Add the 0-term for UJSON4C (but don't count it - see above) */
280280 dbc -> abuff [dbc -> apos ] = '\0' ;
281- DBGH (dbc , "libcurl: copied %zdB : `%.*s`." , have , have , ptr );
281+ DBGH (dbc , "libcurl: copied %zuB : `%.*s`." , have , have , ptr );
282282
283283 /*
284284 * "Your callback should return the number of bytes actually taken care
@@ -293,8 +293,8 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
293293 return have ;
294294
295295too_large :
296- ERRH (dbc , "libcurl: at %zd and can't grow past max %zd for new chunk of "
297- "%zd bytes." , dbc -> apos , dbc -> amax , have );
296+ ERRH (dbc , "libcurl: at %zu and can't grow past max %zu for new chunk of "
297+ "%zu bytes." , dbc -> apos , dbc -> amax , have );
298298 return 0 ;
299299}
300300
@@ -1093,9 +1093,8 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
10931093 ipv6 ? "[" : "" , LWSTR (& attrs -> server ), ipv6 ? "]" : "" ,
10941094 LWSTR (& attrs -> port ));
10951095 if (cnt <= 0 ) {
1096- ERRNH (dbc , "failed to print SQL URL out of server: `" LWPDL "` [%zd], "
1097- "port: `" LWPDL "` [%zd]." , LWSTR (& attrs -> server ),
1098- LWSTR (& attrs -> port ));
1096+ ERRNH (dbc , "failed to print SQL URL out of server: `" LWPDL "`, "
1097+ "port: `" LWPDL "`." , LWSTR (& attrs -> server ), LWSTR (& attrs -> port ));
10991098 SET_HDIAG (dbc , SQL_STATE_HY000 , "printing server's SQL URL failed" , 0 );
11001099 goto err ;
11011100 } else {
@@ -1130,9 +1129,8 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
11301129 ipv6 ? "[" : "" , LWSTR (& attrs -> server ), ipv6 ? "]" : "" ,
11311130 LWSTR (& attrs -> port ));
11321131 if (cnt <= 0 ) {
1133- ERRNH (dbc , "failed to print root URL out of server: `" LWPDL "` [%zd],"
1134- " port: `" LWPDL "` [%zd]." , LWSTR (& attrs -> server ),
1135- LWSTR (& attrs -> port ));
1132+ ERRNH (dbc , "failed to print root URL out of server: `" LWPDL "`,"
1133+ " port: `" LWPDL "`." , LWSTR (& attrs -> server ), LWSTR (& attrs -> port ));
11361134 SET_HDIAG (dbc , SQL_STATE_HY000 , "printing server's URL failed" , 0 );
11371135 goto err ;
11381136 } else {
@@ -1151,16 +1149,16 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
11511149 */
11521150 if (attrs -> uid .cnt ) {
11531151 if (! wstr_to_utf8 (& attrs -> uid , & dbc -> uid )) {
1154- ERRH (dbc , "failed to convert username [%zd ] `" LWPDL "` to UTF8." ,
1152+ ERRH (dbc , "failed to convert username [%zu ] `" LWPDL "` to UTF8." ,
11551153 attrs -> uid .cnt , LWSTR (& attrs -> uid ));
11561154 SET_HDIAG (dbc , SQL_STATE_HY000 , "username UTF8 conversion "
11571155 "failed" , 0 );
11581156 goto err ;
11591157 }
11601158 if (attrs -> pwd .cnt ) {
11611159 if (! wstr_to_utf8 (& attrs -> pwd , & dbc -> pwd )) {
1162- ERRH (dbc , "failed to convert password [%zd] (-not shown-) to "
1163- "UTF8." , attrs -> pwd .cnt );
1160+ ERRH (dbc , "failed to convert password [%zu] `%s` to "
1161+ "UTF8." , attrs -> pwd .cnt , ESODBC_PWD_VAL_SUBST );
11641162 SET_HDIAG (dbc , SQL_STATE_HY000 , "password UTF8 "
11651163 "conversion failed" , 0 );
11661164 goto err ;
@@ -1213,7 +1211,7 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
12131211 WARNH (dbc , "no reply body limit set." );
12141212 }
12151213 }
1216- INFOH (dbc , "max body size: %zd ." , dbc -> amax );
1214+ INFOH (dbc , "max body size: %zu ." , dbc -> amax );
12171215
12181216 /*
12191217 * set max fetch size
@@ -1240,7 +1238,7 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
12401238 dbc -> fetch .slen = (char )attrs -> max_fetch_size .cnt ;
12411239 dbc -> fetch .str = malloc (dbc -> fetch .slen + /*\0*/ 1 );
12421240 if (! dbc -> fetch .str ) {
1243- ERRNH (dbc , "failed to alloc %zdB ." , dbc -> fetch .slen );
1241+ ERRNH (dbc , "failed to alloc %cB ." , dbc -> fetch .slen );
12441242 RET_HDIAGS (dbc , SQL_STATE_HY001 );
12451243 }
12461244 dbc -> fetch .str [dbc -> fetch .slen ] = 0 ;
@@ -1729,8 +1727,8 @@ static BOOL elastic_intervals_name2types(wstr_st *type_name,
17291727 break ;
17301728 }
17311729
1732- ERR ("unrecognized Elastic type `" LWPDL "` (%zd) ." , LWSTR ( type_name ) ,
1733- type_name -> cnt );
1730+ ERR ("unrecognized Elastic type: [%zu] `" LWPDL "`." , type_name -> cnt ,
1731+ LWSTR ( type_name ) );
17341732 return FALSE;
17351733}
17361734
@@ -2409,7 +2407,7 @@ static BOOL load_es_types(esodbc_dbc_st *dbc)
24092407 ERRH (stmt , "Elasticsearch returned no type as supported." );
24102408 goto end ;
24112409 } else if (ESODBC_MAX_NO_TYPES < row_cnt ) {
2412- ERRH (stmt , "Elasticsearch returned too many types (%d vs limit %zd )." ,
2410+ ERRH (stmt , "Elasticsearch returned too many types (%ld vs limit %d )." ,
24132411 row_cnt , ESODBC_MAX_NO_TYPES );
24142412 goto end ;
24152413 } else {
@@ -2425,7 +2423,7 @@ static BOOL load_es_types(esodbc_dbc_st *dbc)
24252423 /* indicate rowset size */
24262424 if (! SQL_SUCCEEDED (EsSQLSetStmtAttrW (stmt , SQL_ATTR_ROW_ARRAY_SIZE ,
24272425 (SQLPOINTER )ESODBC_MAX_NO_TYPES , 0 ))) {
2428- ERRH (stmt , "failed to set rowset size (%zd )." ,
2426+ ERRH (stmt , "failed to set rowset size (%d )." ,
24292427 ESODBC_MAX_NO_TYPES );
24302428 goto end ;
24312429 }
@@ -2724,7 +2722,7 @@ SQLRETURN EsSQLDriverConnectW
27242722 cnt += attrs .server .cnt + /*\0*/ 1 ;
27252723 dbc -> dsn .str = malloc (cnt * sizeof (SQLWCHAR )); /* alloc for both */
27262724 if (! dbc -> dsn .str ) {
2727- ERRNH (dbc , "OOM for %zdB ." , (orig_dsn .cnt + 1 ) * sizeof (SQLWCHAR ));
2725+ ERRNH (dbc , "OOM for %zuB ." , (orig_dsn .cnt + 1 ) * sizeof (SQLWCHAR ));
27282726 RET_HDIAGS (dbc , SQL_STATE_HY001 );
27292727 }
27302728 /* copy DSN */
0 commit comments