Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121631
b: refs/heads/master
c: 2819f8a
h: refs/heads/master
i:
  121629: 430f4a8
  121627: 374dca7
  121623: a4d669a
  121615: 809bae1
  121599: a478c54
v: v3
  • Loading branch information
John W. Linville committed Oct 31, 2008
1 parent 73a0380 commit fbf7cfe
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 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: c5d3dce875ef055ed9b14f169cc967cc2c8faf1f
refs/heads/master: 2819f8ad6da1e24b5dd94a221978e61f2a9c972a
25 changes: 19 additions & 6 deletions trunk/net/wireless/lib80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include <linux/module.h>
#include <linux/ctype.h>
#include <linux/ieee80211.h>

#include <net/lib80211.h>
Expand All @@ -20,19 +21,31 @@ MODULE_LICENSE("GPL");

const char *escape_ssid(const char *ssid, u8 ssid_len)
{
static char escaped[IEEE80211_MAX_SSID_LEN * 2 + 1];
static char escaped[IEEE80211_MAX_SSID_LEN * 4 + 1];
const char *s = ssid;
char *d = escaped;

ssid_len = min_t(u8, ssid_len, IEEE80211_MAX_SSID_LEN);
while (ssid_len--) {
if (*s == '\0') {
*d++ = '\\';
*d++ = '0';
s++;
} else {
if (isprint(*s)) {
*d++ = *s++;
continue;
}

*d++ = '\\';
if (*s == '\0')
*d++ = '0';
else if (*s == '\n')
*d++ = 'n';
else if (*s == '\r')
*d++ = 'r';
else if (*s == '\t')
*d++ = 't';
else if (*s == '\\')
*d++ = '\\';
else
d += snprintf(d, 3, "%03o", *s);
s++;
}
*d = '\0';
return escaped;
Expand Down

0 comments on commit fbf7cfe

Please sign in to comment.