mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
util: Don't use "\e"
'\e' representing ESC (0x1b) is not C standard, it's an GNU extension. https://gcc.gnu.org/onlinedocs/gcc/Character-Escapes.html#Character-Escapes Since the code also compiles on Windows with Microsoft compiler, we should use '\033' instead. Note: I didn't try to build the whole wpa_supplicant on Windows, so I don't know if it still builds (I have no Visual Studio 2005 for a quick test). I just needed the string conversion routines for the P"" syntax in both directions. Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
This commit is contained in:
parent
7c33a65671
commit
a8833b84f4
@ -362,7 +362,7 @@ void printf_encode(char *txt, size_t maxlen, const u8 *data, size_t len)
|
|||||||
*txt++ = '\\';
|
*txt++ = '\\';
|
||||||
*txt++ = '\\';
|
*txt++ = '\\';
|
||||||
break;
|
break;
|
||||||
case '\e':
|
case '\033':
|
||||||
*txt++ = '\\';
|
*txt++ = '\\';
|
||||||
*txt++ = 'e';
|
*txt++ = 'e';
|
||||||
break;
|
break;
|
||||||
@ -427,7 +427,7 @@ size_t printf_decode(u8 *buf, size_t maxlen, const char *str)
|
|||||||
pos++;
|
pos++;
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
buf[len++] = '\e';
|
buf[len++] = '\033';
|
||||||
pos++;
|
pos++;
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
|
Loading…
Reference in New Issue
Block a user