Add strlcpy helper

Same as kernel provides, adopted from Linux sources.

strlcpy is similar to strncpy but _always_ adds \0
at the end of string even if destination is shorter.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov 2013-08-28 19:06:43 +04:00 committed by Pavel Emelyanov
parent aaeff46e52
commit bc002e8537
5 changed files with 62 additions and 0 deletions

View file

@ -12,6 +12,9 @@ ifeq ($(call try-cc,$(TCP_REPAIR_TEST),,),y)
endif
ifeq ($(call try-cc,$(PRLIMIT_TEST),,),y)
$(Q) @echo '#define CONFIG_HAS_PRLIMIT' >> $@
endif
ifeq ($(call try-cc,$(STRLCPY_TEST),,),y)
$(Q) @echo '#define CONFIG_HAS_STRLCPY' >> $@
endif
$(Q) @echo '#endif /* __CR_CONFIG_H__ */' >> $@