lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 20 Dec 2011 08:15:55 +0000
From:	Bart Van Assche <bvanassche@....org>
To:	Jason Baron <jbaron@...hat.com>
Cc:	greg@...ah.com, jim.cromie@...il.com, joe@...ches.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 14/16] dynamic_debug: add trim_prefix() to provide
 source-root relative paths

On Mon, Dec 19, 2011 at 10:13 PM, Jason Baron <jbaron@...hat.com> wrote:
> +/* Return the path relative to source root */
> +static inline const char *trim_prefix(const char *path)
> +{
> +       int skip = strlen(__FILE__) - strlen("lib/dynamic_debug.c");
> +
> +       if (strncmp(path, __FILE__, skip))
> +               skip = 0; /* prefix mismatch, don't skip */
> +
> +       return path + skip;
> +}

Isn't the preferred style to write if (strncmp(...) != 0) ..., i.e. to
mention "!= 0" explicitly instead of leaving it out when comparing
strings ?

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ