Commit 1bd9439b authored by Ben Collins's avatar Ben Collins

[PATCH] kernel/* strlcpy conversion

parent 2f124a73
...@@ -323,8 +323,7 @@ static void do_acct_process(long exitcode, struct file *file) ...@@ -323,8 +323,7 @@ static void do_acct_process(long exitcode, struct file *file)
*/ */
memset((caddr_t)&ac, 0, sizeof(struct acct)); memset((caddr_t)&ac, 0, sizeof(struct acct));
strncpy(ac.ac_comm, current->comm, ACCT_COMM); strlcpy(ac.ac_comm, current->comm, sizeof(ac.ac_comm));
ac.ac_comm[ACCT_COMM - 1] = '\0';
elapsed = get_jiffies_64() - current->start_time; elapsed = get_jiffies_64() - current->start_time;
ac.ac_etime = encode_comp_t(elapsed < (unsigned long) -1l ? ac.ac_etime = encode_comp_t(elapsed < (unsigned long) -1l ?
......
...@@ -362,7 +362,7 @@ static int cpufreq_add_dev (struct class_device * class_dev) ...@@ -362,7 +362,7 @@ static int cpufreq_add_dev (struct class_device * class_dev)
policy->kobj.parent = &class_dev->kobj; policy->kobj.parent = &class_dev->kobj;
policy->kobj.ktype = &ktype_cpufreq; policy->kobj.ktype = &ktype_cpufreq;
// policy->dev = dev->dev; // policy->dev = dev->dev;
strncpy(policy->kobj.name, "cpufreq", KOBJ_NAME_LEN); strlcpy(policy->kobj.name, "cpufreq", KOBJ_NAME_LEN);
ret = kobject_register(&policy->kobj); ret = kobject_register(&policy->kobj);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment