From: "WanRenyong" <wanry@yunsilicon.com>
To: "Stephen Hemminger" <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, <ferruh.yigit@amd.com>, <thomas@monjalon.net>
Subject: Re: [PATCH v2 04/19] net/xsc: add xsc device init and uninit
Date: Thu, 12 Sep 2024 11:58:00 +0800 [thread overview]
Message-ID: <e2a5a0f5-af85-4047-b202-800cb7c41df3@yunsilicon.com> (raw)
In-Reply-To: <20240910204748.1fee9fe1@hermes.local>
On 2024/9/11 11:47, Stephen Hemminger wrote:
> On Wed, 11 Sep 2024 10:07:25 +0800
> "WanRenyong" <wanry@yunsilicon.com> wrote:
>
>> +
>> + sprintf(path, "%s/device/uevent", dev_path);
> better to use snprintf for safety
OK, will fix it in next version.
>> + while (fgets(line, sizeof(line), file) == line) {
>> + size_t len = strlen(line);
>> +
>> + /* Truncate long lines. */
>> + if (len == (sizeof(line) - 1)) {
>> + while (line[(len - 1)] != '\n') {
>> + int n = fgetc(file);
>> +
>> + if (n == EOF)
>> + goto out;
>> + line[(len - 1)] = n;
>> + }
>> + /* No match for long lines. */
>> + continue;
>> + }
> If you have to deal with long lines better to use something
> like getline() that handles arbitrary length.
I will think about it.
Hello Stephen,
Thanks for your review, my reply please see above.
--
Thanks,
WanRenyong
prev parent reply other threads:[~2024-09-12 3:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 2:07 WanRenyong
2024-09-11 3:47 ` Stephen Hemminger
2024-09-12 3:58 ` WanRenyong [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=e2a5a0f5-af85-4047-b202-800cb7c41df3@yunsilicon.com \
--to=wanry@yunsilicon.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/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;
as well as URLs for NNTP newsgroup(s).