diff options
Diffstat (limited to 'sys/kern/kern_ktrace.c')
-rw-r--r-- | sys/kern/kern_ktrace.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 2182ff7..e843da4 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -596,9 +596,8 @@ ktrcsw(out, user) } void -ktrstruct(name, namelen, data, datalen) +ktrstruct(name, data, datalen) const char *name; - size_t namelen; void *data; size_t datalen; { @@ -608,11 +607,10 @@ ktrstruct(name, namelen, data, datalen) if (!data) datalen = 0; - buflen = namelen + 1 + datalen; + buflen = strlen(name) + 1 + datalen; buf = malloc(buflen, M_KTRACE, M_WAITOK); - bcopy(name, buf, namelen); - buf[namelen] = '\0'; - bcopy(data, buf + namelen + 1, datalen); + strcpy(buf, name); + bcopy(data, buf + strlen(name) + 1, datalen); if ((req = ktr_getrequest(KTR_STRUCT)) == NULL) { free(buf, M_KTRACE); return; |