Skip to content

Changes

Summary

  1. utils/smpp_mirror: use OSMO_STRLCPY_ARRAY, fix -Wstringop-overflow (details)
Commit a810a287e24c2860297514561c2977d9f4c7ea3e by Vadim Yanitskiy
utils/smpp_mirror: use OSMO_STRLCPY_ARRAY, fix -Wstringop-overflow

This patch fixes a warning printed by gcc 14.1.1:

  CC       smpp_mirror-smpp_mirror.o
  CCLD     smpp_mirror
In function 'snprintf',
    inlined from 'bind_transceiver' at smpp_mirror.c:121:2,
    inlined from 'smpp_esme_init' at smpp_mirror.c:258:9,
    inlined from 'main' at smpp_mirror.c:299:7:
/usr/include/bits/stdio2.h:54:10: warning: '__builtin___snprintf_chk'
                                  specified bound 16 exceeds destination size 9
                                  [-Wstringop-overflow=]
   54 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^

Take a chance to replace all snprintf() calls with OSMO_STRLCPY_ARRAY.

Change-Id: If1df370fbfbca0953abf83ea1840d8bf8a0118be
The file was modified src/utils/smpp_mirror.c