Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10229
b: refs/heads/master
c: 262d8e4
h: refs/heads/master
i:
  10227: b6e9c35
v: v3
  • Loading branch information
James Ketrenos authored and Jeff Garzik committed Sep 16, 2005
1 parent 28f2b58 commit 17af967
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 18294d8727b825eb2f3f98d6b6ae4a999dff854a
refs/heads/master: 262d8e467710a1c870717bc432caaf74cde3ce20
26 changes: 6 additions & 20 deletions trunk/net/ieee80211/ieee80211_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,34 +195,20 @@ static int show_debug_level(char *page, char **start, off_t offset,
static int store_debug_level(struct file *file, const char __user * buffer,
unsigned long count, void *data)
{
char buf[] = "0x00000000";
char *p = (char *)buf;
char buf[] = "0x00000000\n";
unsigned long len = min((unsigned long)sizeof(buf) - 1, count);
unsigned long val;

if (count > sizeof(buf) - 1)
count = sizeof(buf) - 1;

if (copy_from_user(buf, buffer, count))
if (copy_from_user(buf, buffer, len))
return count;
buf[count] = 0;
/*
* what a FPOS... What, sscanf(buf, "%i", &val) would be too
* scary?
*/
if (p[1] == 'x' || p[1] == 'X' || p[0] == 'x' || p[0] == 'X') {
p++;
if (p[0] == 'x' || p[0] == 'X')
p++;
val = simple_strtoul(p, &p, 16);
} else
val = simple_strtoul(p, &p, 10);
if (p == buf)
buf[len] = 0;
if (sscanf(buf, "%li", &val) != 1)
printk(KERN_INFO DRV_NAME
": %s is not in hex or decimal form.\n", buf);
else
ieee80211_debug_level = val;

return strlen(buf);
return strnlen(buf, len);
}

static int __init ieee80211_init(void)
Expand Down

0 comments on commit 17af967

Please sign in to comment.