On Mon, Jun 15, 2015 at 07:33:13PM -0500, Tyler Hicks wrote:
> It looks odd to access the first character of a string before checking
> to see if the string's length is zero. This is actually fine, in
> practice, since strlen() looks at the first character of the string for
> the presence of '\0' which means this is entirely a cosmetic change.
> 
> Signed-off-by: Tyler Hicks <[email protected]>

Acked-by: Seth Arnold <[email protected]>

Thanks

> ---
>  libraries/libapparmor/src/private.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libraries/libapparmor/src/private.c 
> b/libraries/libapparmor/src/private.c
> index 4769f34..d237a0d 100644
> --- a/libraries/libapparmor/src/private.c
> +++ b/libraries/libapparmor/src/private.c
> @@ -113,7 +113,7 @@ int _aa_is_blacklisted(const char *name, const char *path)
>       struct ignored_suffix_t *suffix;
>  
>       /* skip dot files and files with no name */
> -     if (*name == '.' || !strlen(name))
> +     if (!strlen(name) || *name == '.')
>               return 1;
>  
>       name_len = strlen(name);
> -- 
> 2.1.4
> 
> 
> -- 
> AppArmor mailing list
> [email protected]
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/apparmor
> 

Attachment: signature.asc
Description: Digital signature

-- 
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to