MINOR: sample: implement smp_is_safe() and smp_make_safe()
authorWilly Tarreau <w@1wt.eu>
Tue, 9 Aug 2016 09:37:54 +0000 (11:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 9 Aug 2016 12:03:36 +0000 (14:03 +0200)
commit2c594794dda6b744299dbe322576eb5ef088033c
treeae5e4f2669a5d9e223deb7f3ec844d9197c72cba
parentad63582eb9bc57de6d74674025451780067a56a5
MINOR: sample: implement smp_is_safe() and smp_make_safe()

These functions ensure that the designated sample is "safe for use",
which means that its size is known, its length is correct regarding its
size, and that strings are properly zero-terminated.

smp_is_safe() only checks (and optionally sets the trailing zero when
needed and possible). smp_make_safe() will call smp_dup() after
smp_is_safe() fails.
include/proto/sample.h