* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <stdio.h>
-#include <limits.h>
-#include <ctype.h>
#include "libbb.h"
#define WANT_HEX_ESCAPES 1
#undef _tolower
#define _tolower(X) ((X)|((char) 0x20))
-char bb_process_escape_sequence(const char **ptr)
+char FAST_FUNC bb_process_escape_sequence(const char **ptr)
{
- static const char charmap[] = {
+ static const char charmap[] ALIGN1 = {
'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', 0,
'\a', '\b', '\f', '\n', '\r', '\t', '\v', '\\', '\\' };
#endif
do {
- d = (unsigned int)(*q - '0');
+ d = (unsigned char)(*q) - '0';
#ifdef WANT_HEX_ESCAPES
if (d >= 10) {
- d = ((unsigned int)(_tolower(*q) - 'a')) + 10;
+ d = (unsigned char)(_tolower(*q)) - 'a' + 10;
}
#endif
break;
}
} while (*++p);
- n = *(p+(sizeof(charmap)/2));
+ n = *(p + (sizeof(charmap)/2));
}
*ptr = q;