var: Remove unset check in varnull
PATCH 1/1 var: Remove unset check in varnull
Unset variables always carry two NUL characters at the end so it's safe to call strchrnul in varnull uncondtionally and step past the first NUL character.
Signed-off-by Herbert Xu <[email protected]>
src/var.c +2 -1
@@ -156,7 +156,8 @@ RESET {static char *varnull (const char *s) { -return (strchr (s,'=' ) ?: nullstr -1 ) +1 ; +/* Unset variables always end with two NUL chars. */ +return strchrnul (s,'=' ) +1 ; }/*
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt