/*=========================================================================*
* kstrncpy *
*=========================================================================*/
-PUBLIC char *kstrncpy(char *ret, register const char *s2, register size_t n)
+PUBLIC char *kstrncpy(char *ret, register const char *s2, register ssize_t n)
{
register char *s1 = ret;
while((n-- > 0) && (*s1++ = *s2++)) /* copy up to n chars */
_PROTOTYPE( int kstrncmp,
(register const char *s1, register const char *s2, register size_t n));
_PROTOTYPE( char *kstrncpy,
- (char *s1, register const char *s2, register const size_t n));
+ (char *s1, register const char *s2, register const ssize_t n));
#define karg(arg) (karg_t) (arg)
_PROTOTYPE( void kprintf, (const char *fmt, karg_t arg) );
/* Record miscellaneous information for user-space servers. */
kinfo.nr_procs = NR_PROCS;
kinfo.nr_tasks = NR_TASKS;
- kstrncpy(kinfo.release, OS_RELEASE, 4);
- kstrncpy(kinfo.version, OS_VERSION, 4);
+ kstrncpy(kinfo.release, OS_RELEASE, sizeof(kinfo.release));
+ kinfo.release[sizeof(kinfo.release)-1] = '\0';
+ kstrncpy(kinfo.version, OS_VERSION, sizeof(kinfo.version));
+ kinfo.version[sizeof(kinfo.version)-1] = '\0';
kinfo.proc_addr = (vir_bytes) proc;
kinfo.kmem_base = vir2phys(0);
kinfo.kmem_size = (phys_bytes) &end;