Linux bluetooth development
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Sheldon Demario <sheldon.demario@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v2 3/7] Create helper functions to deal with handles on interactive gatttool
Date: Wed, 23 Feb 2011 00:09:03 -0300	[thread overview]
Message-ID: <20110223030903.GB16014@jh-x301> (raw)
In-Reply-To: <1298401924-20094-3-git-send-email-sheldon.demario@openbossa.org>

Hi Sheldon,

On Tue, Feb 22, 2011, Sheldon Demario wrote:
> +	*dst = strtoll(src, &e, 16);
> +	if (errno != 0 || *e != '\0') {
> +		return -1;
>  	}

Firstly, you've got a coding style issue here: no {} for one-line
scopes. Secondly, are you sure that this is the right way to check for
strtoll failure? If there was some earlier libc function that failed
errno might be set to != 0 even if strtoll succeeds, right? Or are all
errno using libc functions guaranteed to set errno to 0 on success?
Reading the man-page of strtoll it seems you should be checking for
LLONG_MIN and LLONG_MAX return values.

I've pushed the first two patches since they were fine, but I'll stop
here until we get some clarification on this matter.

Johan

  reply	other threads:[~2011-02-23  3:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 22:50 [PATCH 1/7] Improve help messages in interactive gatttool Sheldon Demario
2011-02-21 22:50 ` [PATCH 2/7] Add Characteristics Discovery option to " Sheldon Demario
2011-02-21 22:50 ` [PATCH 3/7] Create helper functions to deal with handles on " Sheldon Demario
2011-02-21 22:50 ` [PATCH 4/7] Add Characteristics Descriptor Discovery option in " Sheldon Demario
2011-02-21 22:50 ` [PATCH 5/7] Add characteristics read options " Sheldon Demario
2011-02-21 22:50 ` [PATCH 6/7] Move attr_data_from_string() to utils.c Sheldon Demario
2011-02-21 22:50 ` [PATCH 7/7] Add Write Request in interactive gatttool Sheldon Demario
2011-02-22 19:11 ` [PATCH v2 1/7] Improve help messages " Sheldon Demario
2011-02-22 19:11 ` [PATCH v2 2/7] Add Characteristics Discovery option to " Sheldon Demario
2011-02-22 19:12 ` [PATCH v2 3/7] Create helper functions to deal with handles on " Sheldon Demario
2011-02-23  3:09   ` Johan Hedberg [this message]
2011-02-23 12:21     ` Anderson Lizardo
2011-02-23 13:23     ` Sheldon Demario
2011-02-23 14:20     ` [PATCH v3 " Sheldon Demario
2011-02-22 19:12 ` [PATCH v2 4/7] Add Characteristics Descriptor Discovery option in " Sheldon Demario
2011-02-22 19:12 ` [PATCH v2 5/7] Add characteristics read options " Sheldon Demario
2011-02-22 19:12 ` [PATCH v2 6/7] Move attr_data_from_string() to utils.c Sheldon Demario
2011-02-22 19:12 ` [PATCH v2 7/7] Add Write Request in interactive gatttool Sheldon Demario
2011-02-24 13:54 ` [PATCH v3 4/7] Add Characteristics Descriptor Discovery option " Sheldon Demario
2011-02-24 13:55 ` [PATCH v3 5/7] Add characteristics read options " Sheldon Demario

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=20110223030903.GB16014@jh-x301 \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=sheldon.demario@openbossa.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox