[rtems-lwip commit] tms570_emac: Fix print formats

Sebastian Huber sebh at rtems.org
Fri Mar 24 10:22:57 UTC 2023


Module:    rtems-lwip
Branch:    master
Commit:    a211bce94fd986fc2c44654aca04ce3c0b38d777
Changeset: http://git.rtems.org/rtems-lwip/commit/?id=a211bce94fd986fc2c44654aca04ce3c0b38d777

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Mar 24 11:40:03 2023 +0100

tms570_emac: Fix print formats

---

 uLan/ports/driver/tms570_emac/eth_lwip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/uLan/ports/driver/tms570_emac/eth_lwip.c b/uLan/ports/driver/tms570_emac/eth_lwip.c
index 0315cdf..9edcc08 100644
--- a/uLan/ports/driver/tms570_emac/eth_lwip.c
+++ b/uLan/ports/driver/tms570_emac/eth_lwip.c
@@ -41,6 +41,7 @@
 #include "eth_lwip.h"
 #include "tms570_netif.h"
 #include <stdio.h>
+#include <inttypes.h>
 
 /* The lwIP network interface structure for the Ethernet EMAC. */
 #ifndef MAX_EMAC_INSTANCE
@@ -149,7 +150,7 @@ eth_lwip_conv_IP_decimal_Str(ip_addr_t ip, uint8_t *ipStr)
   addr = ip.addr;
  #endif
 
-  snprintf((char *)ipStr, 16, "%lu.%lu.%lu.%lu",
+  snprintf((char *)ipStr, 16, "%" PRIu32 ".%" PRIu32 ".%" PRIu32 ".%" PRIu32 "",
            (addr >> 24), ((addr >> 16) & 0xff), ((addr >> 8) & 0xff), (addr & 0xff));
 }
 



More information about the vc mailing list