All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ángel González" <ingenit@zoho.com>
To: Sami Kerola <kerolasa@iki.fi>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH 1/3] a pointer should not be compared to zero [coccinelle]
Date: Sat, 02 Feb 2013 23:58:05 +0100	[thread overview]
Message-ID: <510D99FD.8060608@zoho.com> (raw)
In-Reply-To: <1359578005-13427-1-git-send-email-kerolasa@iki.fi>

On 30/01/13 21:33, Sami Kerola wrote "a pointer should not be compared
to zero":
> Signed-off-by: Sami Kerola <kerolasa@iki.fi>

Why not? It is perfectly legal.
See http://www.c-faq.com/null/null2.html

> ---
> -	if (mnt == 0) {
> +	if (mnt == NULL) {

> -	while ((dp = readdir(dir)) != 0) {
> +	while ((dp = readdir(dir)) != NULL) {

> -	if (Sflag == 0)
> +	if (Sflag == NULL)

> -	if (Bflag == 0) {
> +	if (Bflag == NULL) {

> -	if (Mflag == 0)
> +	if (Mflag == NULL)

> -  if (types == 0) {
> +  if (types == NULL) {

> -				get_logname(&options, &termios, &chardata)) == 0)
> +				get_logname(&options, &termios, &chardata)) == NULL)

> -	for (cp = strtok(arg, ","); cp != 0; cp = strtok((char *)0, ",")) {
> +	for (cp = strtok(arg, ","); cp != NULL; cp = strtok((char *)0, ",")) {

> -		if ((term = getenv("TERM")) == 0) {
> +		if ((term = getenv("TERM")) == NULL) {

> -			if (Home == 0 || *Home == '\0') {
> +			if (Home == NULL || *Home == '\0') {


  parent reply	other threads:[~2013-02-02 23:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30 20:33 [PATCH 1/3] a pointer should not be compared to zero [coccinelle] Sami Kerola
2013-01-30 20:33 ` [PATCH 2/3] translation: unify exec error messages Sami Kerola
2013-02-06 10:53   ` Karel Zak
2013-01-30 20:33 ` [PATCH 3/3] eject: remove a duplicate command name from error message Sami Kerola
2013-02-02 23:00   ` Ángel González
2013-02-06 10:53   ` Karel Zak
2013-02-02 22:58 ` Ángel González [this message]
2013-02-06 11:01   ` [PATCH 1/3] a pointer should not be compared to zero [coccinelle] Karel Zak
2013-02-06 17:47     ` Ángel González

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=510D99FD.8060608@zoho.com \
    --to=ingenit@zoho.com \
    --cc=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.