<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 4, 2020 at 2:22 PM Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">.<span class="gmail_default" style="font-size:small">..</span><br>
- tst_cgroup_cpuset_read_files(PATH_TMP_CG_CST, "cpus", buf);<br>
+ tst_cgroup_cpuset_read_files(PATH_TMP_CG_CST, "cpus", buf, sizeof(buf));<br>
tst_cgroup_cpuset_write_files(PATH_TMP_CG_CST, "cpus", buf);<br>
- tst_cgroup_cpuset_read_files(PATH_TMP_CG_CST, "mems", mems);<br>
+ tst_cgroup_cpuset_read_files(PATH_TMP_CG_CST, "mems", mems, sizeof(buf));<br></blockquote><div><br></div>sizeof() is <span class="gmail_default" style="font-size:small">generally </span>used to calculate the size (in bytes) of a data type<span class="gmail_default" style="font-size:small">, e.g sizeof(char *).</span></div><div class="gmail_quote"><span class="gmail_default" style="font-size:small">I think here to pass 'BUFSIZ' directly is better than sizeof(buf).<br></span></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Jan, do you agree with this point?</div><div class="gmail_default" style="font-size:small">If yes, I can help to modify and apply this patch.</div></div><div> </div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>