summaryrefslogtreecommitdiffstats
path: root/src/gb
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-11-26 10:41:40 +0100
committerHarald Welte <laforge@gnumonks.org>2016-11-26 16:42:17 +0000
commitaeecc48c45e539e0e176dd13d86423e37ffbcee0 (patch)
tree4ed9e7df87e6ca6e13b82cdce3355aa52394e8b1 /src/gb
parent1fa78567e4e1963a28711b9b47111b840b50cfdb (diff)
Introduce osmo_strlcpy() function so we can stop using strncpy()
I'm aware of the existing criticism on stlrcpy(), but I think it is still better than what we have now: stnrcpy(), sometimes with Coverity warnings and sometimes with a manual setting of the termination byte. The implementation follows the linux kernel strlcpy() which is claimed to be BSD compatible. We could of course link against libbsd on Linux instead, but I think it's reasonably small and simple to provide our own implementation. Future versions of libosmocore could use some autoconf magic and preprocessor macros to use the system-provided strlcpy() if it exists. Change-Id: Ifdc99b0e3b8631f1e771e58acaf9efb00a9cd493
Diffstat (limited to 'src/gb')
0 files changed, 0 insertions, 0 deletions