All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thibault, Daniel" <Daniel.Thibault@drdc-rddc.gc.ca>
To: "lttng-dev@lists.lttng.org" <lttng-dev@lists.lttng.org>
Subject: Re: [PATCH lttng-tools] utils: Rework utils_parse_size_suffix
Date: Thu, 10 Apr 2014 18:31:25 +0000	[thread overview]
Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD3599C114__31685.4530516595$1397154765$gmane$org@VAL-E-01.valcartier.drdc-rddc.gc.ca> (raw)

----------------------------------------------------------------------
Date: Thu, 10 Apr 2014 11:30:19 -0400
From: Simon Marchi <simon.marchi@polymtl.ca>

+++ b/src/common/utils.c
@@ -650,42 +649,10 @@ error:
[...]
  * The suffix multiply the integer by:

>>>   Should be "The suffixes multiply the integer by:"

@@ -693,83 +660,94 @@ static void regex_print_error(int errcode, regex_t *regex)
[...]
+	/* strtoull will accept a negative number, but we don't want to. */
+	if (strchr(str, '-') != NULL) {
+		DBG("utils_parse_size_suffix: invalid size string, should not contain '-'.");
 		ret = -1;
+		goto end;
 	}

>>>   Should be "[...] should not begin with '-' [...]" (although it is true the size string should not *contain*, the test is only for *begins with*)

[...]
+	if (num_end == str) {
+		/* strtoull parsed nothing, not good. */
+		DBG("utils_parse_size_suffix: strtoull had nothing good to parse.\n");
+		ret = -1;
+		goto end;
+	}

>>>   "utils_parse_size_suffix: zero-length size string." would be clearer.  Also note that the preceding DBG strings did not end with '\n'.

+	/* Check if a prefix is present. */

>>>   That should be "suffix".

[...]
+	default:
+		DBG("utils_parse_size_suffix: invalid suffix.\n");

>>>   Another DBG string with a superfluous trailing '\n'.

Daniel U. Thibault
Protection des systèmes et contremesures (PSC) | Systems Protection & Countermeasures (SPC)
Cyber sécurité pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS)
R & D pour la défense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier)
2459 route de la Bravoure
Québec QC  G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
Gouvernement du Canada | Government of Canada
<http://www.valcartier.drdc-rddc.gc.ca/>

             reply	other threads:[~2014-04-10 18:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10 18:31 Thibault, Daniel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-04-10 20:22 [PATCH lttng-tools] utils: Rework utils_parse_size_suffix Thibault, Daniel
     [not found] <1397143819-4563-1-git-send-email-simon.marchi@polymtl.ca>
2014-04-10 19:57 ` David Goulet
     [not found] ` <20140410195751.GE28773@dalia>
2014-04-10 20:14   ` Simon Marchi
2014-04-14 14:44 ` David Goulet
     [not found] <48CF5AC71E61DB46B70D0F388054EFFD3599C114@VAL-E-01.valcartier.drdc-rddc.gc.ca>
2014-04-10 18:43 ` Simon Marchi
2014-04-10 15:30 Simon Marchi

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='48CF5AC71E61DB46B70D0F388054EFFD3599C114__31685.4530516595$1397154765$gmane$org@VAL-E-01.valcartier.drdc-rddc.gc.ca' \
    --to=daniel.thibault@drdc-rddc.gc.ca \
    --cc=lttng-dev@lists.lttng.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.