public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Jackson <pj@sgi.com>
To: Mike Kravetz <kravetz@us.ibm.com>
Cc: akpm@osdl.org, viro@math.psu.edu, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] task name handling in proc fs
Date: Wed, 7 Jul 2004 19:32:22 -0700	[thread overview]
Message-ID: <20040707193222.6604f752.pj@sgi.com> (raw)
In-Reply-To: <20040707233532.GD4314@w-mikek2.beaverton.ibm.com>

+void set_task_comm(struct task_struct *tsk, char *buf)
+{ ...
+	for(i=0; i<sizeof(tsk->comm); i++) {
+		tsk->comm[i] = *buf++;
+		if (!tsk->comm[i])
+			break;
+	}
+	tsk->comm[sizeof(tsk->comm)-1] = '\0';	/* just in case */

That code fragment looks to me like:

	strlcpy (tsk->comm, buf, sizeof(tsk->comm));

Unless I'm missing something, I'd prefer 'strlcpy'.

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373

  reply	other threads:[~2004-07-08  2:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-01 22:05 [PATCH] task name handling in proc fs Mike Kravetz
2004-07-01 22:19 ` Andrew Morton
2004-07-01 22:42   ` Mike Kravetz
2004-07-01 23:03     ` Andrew Morton
2004-07-01 23:38       ` Mike Kravetz
2004-07-07 21:52       ` Mike Kravetz
2004-07-07 22:11         ` Andrew Morton
2004-07-07 23:35           ` Mike Kravetz
2004-07-08  2:32             ` Paul Jackson [this message]
2004-07-08 17:01               ` Mike Kravetz
2004-07-02  1:27     ` Andrew Rodland

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=20040707193222.6604f752.pj@sgi.com \
    --to=pj@sgi.com \
    --cc=akpm@osdl.org \
    --cc=kravetz@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@math.psu.edu \
    /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