[PATCH 3/6] internal: Add STRLIM macro for checking string length using strnlen()

Ján Tomko jtomko at redhat.com
Thu Nov 25 13:57:55 UTC 2021


On a Thursday in 2021, Peter Krempa wrote:
>As a microoprimization when checking whether length of a string fits
>into a limit we don't necessarily need to calculate the full lenght but

length

>can use strnlen to check only LIMIT+1 chars. Add a macro which will
>simplify the expressions.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/internal.h | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20211125/f30711e8/attachment-0001.sig>


More information about the libvir-list mailing list