DragonFly BSD
DragonFly kernel List (threaded) for 2003-12
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: kdebase patch


From: David Leimbach <leimy2k@xxxxxxx>
Date: Wed, 17 Dec 2003 16:31:42 -0600


On Dec 17, 2003, at 4:24 PM, Matthew Dillon wrote:



:This patch builds kdebase out of CVS.
:
:Thanks to Dave Rhodus for his help on it and the other fine folks hanging
:out in #dragonflybsd on Efnet.
:----------------------------------------------------------------------
:
: ps->vmRss = p.kp_eproc.e_vm.vm_rssize * getpagesize();
:- strlcpy(ps->name,p.kp_proc.p_comm ? p.kp_proc.p_comm : "????", sizeof(p
:s->name));
:+ /*strlcpy(ps->name,p.kp_proc.p_comm ? p.kp_proc.p_comm : "????", sizeof
:(ps->name));*/
:+ strncpy(ps->name,p.kp_thread.td_comm ? p.kp_thread.td_comm : "????", si
:zeof(ps->name));
: strcpy(ps->status,(p.kp_proc.p_stat>=1)&&(p.kp_proc.p_stat<=5)? statuse
:s[p.kp_proc.p_stat-1]:"????");
: #endif
:----------------------------------------------------------------------
:
:Thanks again... Its working well here. :)
:
:Dave


I am fairly sure that strncpy is not compatible with strlcpy. strncpy
will happily NOT terminate the target buffer with a \0 if the source
buffer is too large.


But we should have strlcpy(). Do we not have strlcpy() ?

You are correct... some of this came from a patch that was applied to a KDE snapshot vs what I am doing in CVS HEAD. Good catch!

I will fix it. I think we do in fact have stlcpy. There is a man page for it anyway.

Dave


-Matt Matthew Dillon <dillon@xxxxxxxxxxxxx>




[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]