Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions net/oic/src/port/mynewt/ip_adaptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ oc_send_buffer_ip6_int(struct os_mbuf *m, int is_mcast)
to.msin6_scope_id = itf2.mif_idx;
rc = mn_sendto(oc_ucast6, n, (struct mn_sockaddr *) &to);
if (rc != 0) {
OC_LOG_ERROR("Failed to send buffer %u on itf %d\n",
OS_MBUF_PKTHDR(m)->omp_len, to.msin6_scope_id);
OC_LOG_ERROR("Failed to send buffer %u on itf %u\n",
OS_MBUF_PKTHDR(m)->omp_len,
(unsigned int)to.msin6_scope_id);
STATS_INC(oc_ip_stats, oerr);
os_mbuf_free_chain(n);
}
Expand All @@ -176,8 +177,9 @@ oc_send_buffer_ip6_int(struct os_mbuf *m, int is_mcast)
to.msin6_scope_id = itf2.mif_idx;
rc = mn_sendto(oc_ucast6, m, (struct mn_sockaddr *) &to);
if (rc != 0) {
OC_LOG_ERROR("Failed sending buffer %u on itf %d\n",
OS_MBUF_PKTHDR(m)->omp_len, to.msin6_scope_id);
OC_LOG_ERROR("Failed sending buffer %u on itf %u\n",
OS_MBUF_PKTHDR(m)->omp_len,
(unsigned int)to.msin6_scope_id);
STATS_INC(oc_ip_stats, oerr);
os_mbuf_free_chain(m);
}
Expand All @@ -187,8 +189,8 @@ oc_send_buffer_ip6_int(struct os_mbuf *m, int is_mcast)
} else {
rc = mn_sendto(oc_ucast6, m, (struct mn_sockaddr *) &to);
if (rc != 0) {
OC_LOG_ERROR("Failed to send buffer %u on itf %d\n",
OS_MBUF_PKTHDR(m)->omp_len, to.msin6_scope_id);
OC_LOG_ERROR("Failed to send buffer %u on itf %u\n",
OS_MBUF_PKTHDR(m)->omp_len, (unsigned int)to.msin6_scope_id);
STATS_INC(oc_ip_stats, oerr);
os_mbuf_free_chain(m);
}
Expand Down
2 changes: 1 addition & 1 deletion net/osdp/src/osdp_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ osdp_phy_check_packet(struct osdp_pd *pd, uint8_t *buf, int len,

if (!ISSET_FLAG(pd, PD_FLAG_PD_MODE) &&
!(pkt->pd_address & 0x80)) {
OSDP_LOG_ERROR("Reply without address MSB set!\n", pkt->pd_address);
OSDP_LOG_ERROR("Reply without address MSB set 0x%02x!\n", pkt->pd_address);
return OSDP_ERR_PKT_FMT;
}

Expand Down
7 changes: 6 additions & 1 deletion sys/log/modlog/include/modlog/modlog.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,12 @@ int modlog_foreach(modlog_foreach_fn *fn, void *arg);
* @param level The severity of the log entry to write.
* @param msg The "printf" formatted string to write.
*/
void modlog_printf(uint8_t module, uint8_t level, const char *msg, ...);

void modlog_printf(uint8_t module, uint8_t level, const char *msg, ...)
#if MYNEWT_VAL(MODLOG_USE_PRINTF_ATTRIBUTE)
__attribute__((format(printf, 3, 4)))
#endif
;

/**
* @brief Writes a specified number of bytes as a text entry to the specified log module.
Expand Down
6 changes: 6 additions & 0 deletions sys/log/modlog/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@ syscfg.defs:
description: >
Sysinit stage for modular logging functionality.
value: 100
MODLOG_USE_PRINTF_ATTRIBUTE:
description: >
Use the `format(printf, ...)` attribute on the modlog_printf
prototype. Enables compile-time checking of modlog_printf arguments
against the format string.
value: 0
Loading