mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-08-19 12:11:30 +03:00
[ledtrig-netdev]
we dont need 1024 bytes buffer. 128 bytes is enough. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27143 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
a9c1e1b2b5
commit
eb72b14048
@ -182,13 +182,13 @@ static ssize_t led_mode_store(struct device *dev,
|
|||||||
{
|
{
|
||||||
struct led_classdev *led_cdev = dev_get_drvdata(dev);
|
struct led_classdev *led_cdev = dev_get_drvdata(dev);
|
||||||
struct led_netdev_data *trigger_data = led_cdev->trigger_data;
|
struct led_netdev_data *trigger_data = led_cdev->trigger_data;
|
||||||
char copybuf[1024];
|
char copybuf[128];
|
||||||
int new_mode = -1;
|
int new_mode = -1;
|
||||||
char *p, *token;
|
char *p, *token;
|
||||||
|
|
||||||
/* take a copy since we don't want to trash the inbound buffer when using strsep */
|
/* take a copy since we don't want to trash the inbound buffer when using strsep */
|
||||||
strncpy(copybuf, buf, sizeof(copybuf));
|
strncpy(copybuf, buf, sizeof(copybuf));
|
||||||
copybuf[1023] = 0;
|
copybuf[sizeof(copybuf) - 1] = 0;
|
||||||
p = copybuf;
|
p = copybuf;
|
||||||
|
|
||||||
while ((token = strsep(&p, " \t\n")) != NULL) {
|
while ((token = strsep(&p, " \t\n")) != NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user