From: Cyril Hrubis <chrubis@suse.cz>
To: Richard Palethorpe <rpalethorpe@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/3] API/cgroup: Add safe_cgroup_lines_scanf
Date: Mon, 20 Dec 2021 16:08:48 +0100 [thread overview]
Message-ID: <YcCcgEZR8OyN7xbv@yuki> (raw)
In-Reply-To: <20211220131043.18894-1-rpalethorpe@suse.com>
Hi!
> +void safe_cgroup_lines_scanf(const char *const file, const int lineno,
> + const struct tst_cgroup_group *const cg,
> + const char *const file_name,
> + const char *const fmt, ...)
> +{
> + va_list va;
> + char buf[BUFSIZ];
> + ssize_t len = safe_cgroup_read(file, lineno,
> + cg, file_name, buf, sizeof(buf));
> + const int conv_cnt = tst_count_scanf_conversions(fmt);
> + int ret = 0;
> + char *line;
> +
> + if (len < 1)
> + return;
> +
> + line = strtok(buf, "\n");
It may be safer to use strtok_r() other than that:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2021-12-20 15:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-20 13:10 [LTP] [PATCH 1/3] API/cgroup: Add safe_cgroup_lines_scanf Richard Palethorpe via ltp
2021-12-20 13:10 ` [LTP] [PATCH 2/3] API/cgroup: Add memory.stat Richard Palethorpe via ltp
2021-12-20 15:15 ` Cyril Hrubis
2021-12-20 13:10 ` [LTP] [PATCH 3/3] cgroup: Add memcontrol02 Richard Palethorpe via ltp
2021-12-20 15:44 ` Cyril Hrubis
2021-12-21 8:38 ` Richard Palethorpe
2021-12-21 11:14 ` Cyril Hrubis
2021-12-20 15:08 ` Cyril Hrubis [this message]
2021-12-30 10:37 ` [LTP] [PATCH v2 1/5] API/cgroup: Add safe_cgroup_lines_scanf Richard Palethorpe via ltp
2021-12-30 10:37 ` [LTP] [PATCH v2 2/5] API/cgroup: Add memory.stat Richard Palethorpe via ltp
2021-12-30 10:37 ` [LTP] [PATCH v2 3/5] API/fs: Add exfat magic Richard Palethorpe via ltp
2021-12-30 10:37 ` [LTP] [PATCH v2 4/5] API: Add TST_EXP_EXPR macro Richard Palethorpe via ltp
2021-12-30 10:37 ` [LTP] [PATCH v2 5/5] cgroup: Add memcontrol02 Richard Palethorpe via ltp
2022-01-03 9:45 ` Petr Vorel
2022-01-03 9:51 ` [LTP] [PATCH v2 1/5] API/cgroup: Add safe_cgroup_lines_scanf Petr Vorel
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=YcCcgEZR8OyN7xbv@yuki \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=rpalethorpe@suse.com \
/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