Skip to content

Commit

Permalink
Fix printf format warnings (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
babelouest committed Feb 18, 2024
1 parent ff0b0da commit 7c444e7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/client/ldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,11 +840,11 @@ static LDAPMod ** get_ldap_write_mod(json_t * j_params, json_t * j_client, int a
json_array_append_new(j_mod_value_free_array, json_integer(i));
}
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "get_ldap_write_mod - Error allocating resources for mods[%zu]->mod_values (%s)", i, json_string_value(json_object_get(j_format, "property")));
y_log_message(Y_LOG_LEVEL_ERROR, "get_ldap_write_mod - Error allocating resources for mods[%u]->mod_values (%s)", i, json_string_value(json_object_get(j_format, "property")));
has_error = 1;
}
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "get_ldap_write_mod - Error allocating resources for mods[%zu] (%s)", i, json_string_value(json_object_get(j_format, "property")));
y_log_message(Y_LOG_LEVEL_ERROR, "get_ldap_write_mod - Error allocating resources for mods[%u] (%s)", i, json_string_value(json_object_get(j_format, "property")));
has_error = 1;
}
} else if (json_object_get(json_object_get(json_object_get(j_params, "data-format"), field), "multiple") != json_true()) {
Expand Down Expand Up @@ -872,11 +872,11 @@ static LDAPMod ** get_ldap_write_mod(json_t * j_params, json_t * j_client, int a
}
mods[i]->mod_values[1] = NULL;
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "get_ldap_write_mod - Error allocating resources for mods[%zu]->mod_values (%s)", i, json_string_value(json_object_get(j_format, "property")));
y_log_message(Y_LOG_LEVEL_ERROR, "get_ldap_write_mod - Error allocating resources for mods[%u]->mod_values (%s)", i, json_string_value(json_object_get(j_format, "property")));
has_error = 1;
}
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "get_ldap_write_mod - Error allocating resources for mods[%zu] (%s)", i, json_string_value(json_object_get(j_format, "property")));
y_log_message(Y_LOG_LEVEL_ERROR, "get_ldap_write_mod - Error allocating resources for mods[%u] (%s)", i, json_string_value(json_object_get(j_format, "property")));
has_error = 1;
}
} else {
Expand Down
12 changes: 6 additions & 6 deletions src/plugin/protocol_oidc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5298,7 +5298,7 @@ static char * get_request_from_uri(struct _oidc_config * config, const char * re
y_log_message(Y_LOG_LEVEL_ERROR, "get_request_from_uri - Error invalid content type");
}
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "get_request_from_uri - Error ulfius_send_http_request_with_limit response status is %d", resp.status);
y_log_message(Y_LOG_LEVEL_ERROR, "get_request_from_uri - Error ulfius_send_http_request_with_limit response status is %ld", resp.status);
}

ulfius_clean_request(&req);
Expand Down Expand Up @@ -6092,7 +6092,7 @@ static int send_ciba_client_notification(struct _oidc_config * config, json_t *
if (resp.status == 200 || resp.status == 204) {
ret = G_OK;
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "send_ciba_client_notification ping - Invalid response status: %d", resp.status);
y_log_message(Y_LOG_LEVEL_ERROR, "send_ciba_client_notification ping - Invalid response status: %ld", resp.status);
ret = G_ERROR;
}
} else {
Expand Down Expand Up @@ -6129,7 +6129,7 @@ static int send_ciba_client_notification(struct _oidc_config * config, json_t *
if (resp.status == 200 || resp.status == 204) {
ret = G_OK;
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "send_ciba_client_notification push - Invalid response status: %d", resp.status);
y_log_message(Y_LOG_LEVEL_ERROR, "send_ciba_client_notification push - Invalid response status: %ld", resp.status);
ret = G_ERROR;
}
} else {
Expand Down Expand Up @@ -6175,7 +6175,7 @@ static int send_ciba_client_notification(struct _oidc_config * config, json_t *
if (resp.status == 200 || resp.status == 204) {
ret = G_OK;
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "send_ciba_client_notification ping - Invalid response status: %d", resp.status);
y_log_message(Y_LOG_LEVEL_ERROR, "send_ciba_client_notification ping - Invalid response status: %ld", resp.status);
ret = G_ERROR;
}
} else {
Expand Down Expand Up @@ -13203,8 +13203,8 @@ static void * run_backchannel_logout_thread(void * args) {
if (resp.status == 200) {
y_log_message(Y_LOG_LEVEL_DEBUG, "Send backchannel_logout successfully for client %s", json_string_value(json_object_get(json_object_get(j_client, "client"), "client_id")));
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "run_backchannel_logout_thread - Error backchannel_logout response for client %s, response status %d", json_string_value(json_object_get(json_object_get(j_client, "client"), "client_id")), resp.status);
y_log_message(Y_LOG_LEVEL_DEBUG, " - response body %.*s", resp.binary_body_length, resp.binary_body);
y_log_message(Y_LOG_LEVEL_ERROR, "run_backchannel_logout_thread - Error backchannel_logout response for client %s, response status %ld", json_string_value(json_object_get(json_object_get(j_client, "client"), "client_id")), resp.status);
y_log_message(Y_LOG_LEVEL_DEBUG, " - response body %.*s", (int)resp.binary_body_length, resp.binary_body);
}
} else {
y_log_message(Y_LOG_LEVEL_ERROR, "run_backchannel_logout_thread - Error ulfius_send_http_request_with_limit for client %s", json_string_value(json_object_get(json_object_get(j_client, "client"), "client_id")));
Expand Down
8 changes: 4 additions & 4 deletions src/scheme/webauthn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ static json_t * check_attestation_android_safetynet(json_t * j_params, cbor_item
} else if (0 == o_strncmp((const char *)cbor_string_handle(key), "response", MIN(o_strlen("response"), cbor_string_length(key))) && cbor_isa_bytestring(cbor_map_handle(att_stmt)[i].value)) {
response = cbor_map_handle(att_stmt)[i].value;
} else {
message = msprintf("attStmt map element %d key is not valid: '%.*s'", i, cbor_string_length(key), cbor_string_handle(key));
message = msprintf("attStmt map element %d key is not valid: '%.*s'", i, (int)cbor_string_length(key), cbor_string_handle(key));
json_array_append_new(j_error, json_string(message));
o_free(message);
break;
Expand Down Expand Up @@ -1796,7 +1796,7 @@ static json_t * check_attestation_android_safetynet(json_t * j_params, cbor_item
}
if (o_strnstr(issued_to, SAFETYNET_ISSUED_TO, issued_to_len) == NULL) {
json_array_append_new(j_error, json_string("Error x509 dn"));
y_log_message(Y_LOG_LEVEL_DEBUG, "check_attestation_android_safetynet - safetynet certificate issued for %.*s", issued_to_len, issued_to);
y_log_message(Y_LOG_LEVEL_DEBUG, "check_attestation_android_safetynet - safetynet certificate issued for %.*s", (int)issued_to_len, issued_to);
break;
}
if (json_object_get(j_params, "google-root-ca-r2") != json_null()) {
Expand Down Expand Up @@ -1887,7 +1887,7 @@ static json_t * check_attestation_fido_u2f(json_t * j_params, unsigned char * cr
} else if (0 == o_strncmp((const char *)cbor_string_handle(key), "sig", MIN(o_strlen("sig"), cbor_string_length(key)))) {
sig = cbor_map_handle(att_stmt)[i].value;
} else {
message = msprintf("attStmt map element %d key is not valid: '%.*s'", i, cbor_string_length(key), cbor_string_handle(key));
message = msprintf("attStmt map element %d key is not valid: '%.*s'", i, (int)cbor_string_length(key), cbor_string_handle(key));
json_array_append_new(j_error, json_string(message));
o_free(message);
break;
Expand Down Expand Up @@ -2425,7 +2425,7 @@ static json_t * register_new_attestation(struct config_module * config, json_t *
ret = G_ERROR_PARAM;
}
} else {
message = msprintf("Format '%.*s' is not supported by Glewlwyd WebAuthn scheme", fmt_len, fmt);
message = msprintf("Format '%.*s' is not supported by Glewlwyd WebAuthn scheme", (int)fmt_len, fmt);
json_array_append_new(j_error, json_string(message));
o_free(message);
ret = G_ERROR_PARAM;
Expand Down

0 comments on commit 7c444e7

Please sign in to comment.