drivers/net/wireless/iwlegacy: use strlcpy instead of strncpy

The fields must be null-terminated, or simple_strtoul will cause issue.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Chen Gang 2013-01-07 12:42:46 +08:00 committed by John W. Linville
parent c4f74d35ca
commit 407ee23725

View file

@ -3273,7 +3273,7 @@ il3945_store_measurement(struct device *d, struct device_attribute *attr,
if (count) {
char *p = buffer;
strncpy(buffer, buf, min(sizeof(buffer), count));
strlcpy(buffer, buf, sizeof(buffer));
channel = simple_strtoul(p, NULL, 0);
if (channel)
params.channel = channel;