we dont need 1024 bytes buffer. 128 bytes is enough.
authorJohn Crispin <john@openwrt.org>
Thu, 9 Jun 2011 07:08:54 +0000 (07:08 +0000)
committerJohn Crispin <john@openwrt.org>
Thu, 9 Jun 2011 07:08:54 +0000 (07:08 +0000)
SVN-Revision: 27143

target/linux/generic/files/drivers/leds/ledtrig-netdev.c

index 8dba8e654d26a290e74c48b158110351a687e0f0..6c56acb27da847914843de015334c0979150f305 100644 (file)
@@ -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) {