libnetconf2 BUGFIX proper uint32_t print macros
diff --git a/src/io.c b/src/io.c
index 15123e5..48da5af 100644
--- a/src/io.c
+++ b/src/io.c
@@ -1100,7 +1100,7 @@
nc_write_clb((void *)&arg, "</capability>", 13, 0);
}
if (sid) {
- count = asprintf(&buf, "</capabilities><session-id>%u</session-id></hello>", *sid);
+ count = asprintf(&buf, "</capabilities><session-id>%" PRIu32 "</session-id></hello>", *sid);
NC_CHECK_ERRMEM_GOTO(count == -1, ret = NC_MSG_ERROR, cleanup);
nc_write_clb((void *)&arg, buf, count, 0);
free(buf);
diff --git a/src/log.c b/src/log.c
index 1a6dd80..e2079d1 100644
--- a/src/log.c
+++ b/src/log.c
@@ -103,7 +103,7 @@
if (print_clb) {
print_clb(session, level, prv_msg);
} else if (session && session->id) {
- fprintf(stderr, "Session %u %s: %s\n", session->id, verb[level].label, prv_msg);
+ fprintf(stderr, "Session %" PRIu32 " %s: %s\n", session->id, verb[level].label, prv_msg);
} else {
fprintf(stderr, "%s: %s\n", verb[level].label, prv_msg);
}
diff --git a/src/server_config_util_tls.c b/src/server_config_util_tls.c
index aeb9113..9301a7a 100644
--- a/src/server_config_util_tls.c
+++ b/src/server_config_util_tls.c
@@ -701,7 +701,7 @@
NC_CHECK_ARG_RET(NULL, ctx, endpt_name, id, name, config, 1);
ret = asprintf(&path, "/ietf-netconf-server:netconf-server/listen/endpoints/endpoint[name='%s']/tls/netconf-server-parameters/"
- "client-identity-mappings/cert-to-name[id='%u']", endpt_name, id);
+ "client-identity-mappings/cert-to-name[id='%" PRIu32 "']", endpt_name, id);
NC_CHECK_ERRMEM_GOTO(ret == -1, path = NULL; ret = 1, cleanup);
ret = _nc_server_config_add_tls_ctn(ctx, path, fingerprint, map_type, name, config);
@@ -722,7 +722,7 @@
if (id) {
return nc_server_config_delete(config, "/ietf-netconf-server:netconf-server/listen/endpoints/endpoint[name='%s']/tls/"
- "netconf-server-parameters/client-identity-mappings/cert-to-name[id='%u']", endpt_name, id);
+ "netconf-server-parameters/client-identity-mappings/cert-to-name[id='%" PRIu32 "']", endpt_name, id);
} else {
return nc_server_config_delete(config, "/ietf-netconf-server:netconf-server/listen/endpoints/endpoint[name='%s']/tls/"
"netconf-server-parameters/client-identity-mappings/cert-to-name", endpt_name);
@@ -740,7 +740,7 @@
ret = asprintf(&path, "/ietf-netconf-server:netconf-server/call-home/netconf-client[name='%s']/"
"endpoints/endpoint[name='%s']/tls/netconf-server-parameters/client-identity-mappings/"
- "cert-to-name[id='%u']", client_name, endpt_name, id);
+ "cert-to-name[id='%" PRIu32 "']", client_name, endpt_name, id);
NC_CHECK_ERRMEM_GOTO(ret == -1, path = NULL; ret = 1, cleanup);
ret = _nc_server_config_add_tls_ctn(ctx, path, fingerprint, map_type, name, config);
diff --git a/src/session_client.c b/src/session_client.c
index 69e8f35..8b851dd 100644
--- a/src/session_client.c
+++ b/src/session_client.c
@@ -2800,7 +2800,7 @@
rpc_k = (struct nc_rpc_kill *)rpc;
CHECK_LYRC_BREAK(lyd_new_inner(NULL, mod, "kill-session", 0, &data));
- sprintf(str, "%u", rpc_k->sid);
+ sprintf(str, "%" PRIu32, rpc_k->sid);
CHECK_LYRC_BREAK(lyd_new_term(data, mod, "session-id", str, 0, NULL));
break;
@@ -2813,7 +2813,7 @@
}
if (rpc_com->confirm_timeout) {
- sprintf(str, "%u", rpc_com->confirm_timeout);
+ sprintf(str, "%" PRIu32, rpc_com->confirm_timeout);
CHECK_LYRC_BREAK(lyd_new_term(data, mod, "confirm-timeout", str, 0, NULL));
}
if (rpc_com->persist) {
@@ -2976,7 +2976,7 @@
CHECK_LYRC_BREAK(lyd_new_inner(NULL, mod, "modify-subscription", 0, &data));
- sprintf(str, "%u", rpc_modsub->id);
+ sprintf(str, "%" PRIu32, rpc_modsub->id);
CHECK_LYRC_BREAK(lyd_new_term(data, mod, "id", str, 0, NULL));
if (rpc_modsub->filter) {
@@ -2999,7 +2999,7 @@
CHECK_LYRC_BREAK(lyd_new_inner(NULL, mod, "delete-subscription", 0, &data));
- sprintf(str, "%u", rpc_delsub->id);
+ sprintf(str, "%" PRIu32, rpc_delsub->id);
CHECK_LYRC_BREAK(lyd_new_term(data, mod, "id", str, 0, NULL));
break;
@@ -3008,7 +3008,7 @@
CHECK_LYRC_BREAK(lyd_new_inner(NULL, mod, "kill-subscription", 0, &data));
- sprintf(str, "%u", rpc_killsub->id);
+ sprintf(str, "%" PRIu32, rpc_killsub->id);
CHECK_LYRC_BREAK(lyd_new_term(data, mod, "id", str, 0, NULL));
break;
@@ -3065,7 +3065,7 @@
CHECK_LYRC_BREAK(lyd_new_inner(NULL, mod, "modify-subscription", 0, &data));
- sprintf(str, "%u", rpc_modpush->id);
+ sprintf(str, "%" PRIu32, rpc_modpush->id);
CHECK_LYRC_BREAK(lyd_new_term(data, mod, "id", str, 0, NULL));
CHECK_LYRC_BREAK(lyd_new_term(data, mod2, "datastore", rpc_modpush->datastore, 0, NULL));
@@ -3103,7 +3103,7 @@
rpc_resyncsub = (struct nc_rpc_resyncsub *)rpc;
CHECK_LYRC_BREAK(lyd_new_inner(NULL, mod, "resync-subscription", 0, &data));
- sprintf(str, "%u", rpc_resyncsub->id);
+ sprintf(str, "%" PRIu32, rpc_resyncsub->id);
CHECK_LYRC_BREAK(lyd_new_term(data, mod, "id", str, 0, NULL));
break;