Messages in this thread | | | Date | Wed, 7 Jul 2004 19:32:22 -0700 | From | Paul Jackson <> | Subject | Re: [PATCH] task name handling in proc fs |
| |
+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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |