summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2011-06-09 07:08:54 +0000
committerJohn Crispin <john@openwrt.org>2011-06-09 07:08:54 +0000
commite3e2a170cd3f3254a82af0c43f91ad1281a8cac4 (patch)
tree6d3e6170eea7813c742e7371363d722c5f5cde4b
parent8329ecf92c3ae285410ca01f623ff4c38402aa22 (diff)
downloadmtk-20170518-e3e2a170cd3f3254a82af0c43f91ad1281a8cac4.zip
mtk-20170518-e3e2a170cd3f3254a82af0c43f91ad1281a8cac4.tar.gz
mtk-20170518-e3e2a170cd3f3254a82af0c43f91ad1281a8cac4.tar.bz2
we dont need 1024 bytes buffer. 128 bytes is enough.
SVN-Revision: 27143
-rw-r--r--target/linux/generic/files/drivers/leds/ledtrig-netdev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/linux/generic/files/drivers/leds/ledtrig-netdev.c b/target/linux/generic/files/drivers/leds/ledtrig-netdev.c
index 8dba8e6..6c56acb 100644
--- a/target/linux/generic/files/drivers/leds/ledtrig-netdev.c
+++ b/target/linux/generic/files/drivers/leds/ledtrig-netdev.c
@@ -182,13 +182,13 @@ static ssize_t led_mode_store(struct device *dev,
{
struct led_classdev *led_cdev = dev_get_drvdata(dev);
struct led_netdev_data *trigger_data = led_cdev->trigger_data;
- char copybuf[1024];
+ char copybuf[128];
int new_mode = -1;
char *p, *token;
/* take a copy since we don't want to trash the inbound buffer when using strsep */
strncpy(copybuf, buf, sizeof(copybuf));
- copybuf[1023] = 0;
+ copybuf[sizeof(copybuf) - 1] = 0;
p = copybuf;
while ((token = strsep(&p, " \t\n")) != NULL) {