lkml.org 
[lkml]   [2004]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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/

    \
     
     \ /
      Last update: 2005-03-22 14:04    [W:3.054 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site