From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] Add tst_parse_filesize functionality in LTP test API
Date: Tue, 7 Dec 2021 13:56:14 +0100 [thread overview]
Message-ID: <Ya9Z7ukjNryOs2vM@yuki> (raw)
In-Reply-To: <Ya9ZYCErHU/XqjLn@yuki>
Hi!
> > + if (str == end || (strlen(end) != 0 && strlen(end) != 1))
>
> No need for the strlen() here. what you do here is a fancy way of doing (!end[0] && !end[1]).
And of course it should be (end[0] && end[1]) that means that the string
is not terminated.
Or optionally (strlen(end) > 1) would work too.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2021-12-07 12:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-07 11:46 [LTP] [PATCH v2] Add tst_parse_filesize functionality in LTP test API Andrea Cervesato via ltp
2021-12-07 12:53 ` Cyril Hrubis
2021-12-07 12:56 ` Cyril Hrubis [this message]
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=Ya9Z7ukjNryOs2vM@yuki \
--to=chrubis@suse.cz \
--cc=andrea.cervesato@suse.com \
--cc=ltp@lists.linux.it \
/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