Remove redundant textlen() function.

This commit is contained in:
Daniel Beer 2010-08-17 10:22:16 +12:00
parent 30c3d8e6f1
commit 93c3cb342b
2 changed files with 0 additions and 25 deletions

22
util.c
View File

@ -249,25 +249,3 @@ void debug_hexdump(const char *label, const uint8_t *data, int len)
offset += i;
}
}
int textlen(const char *text)
{
int count = 0;
for (;;) {
if (*text == 27) {
while (*text && !isalpha(*text))
text++;
if (*text)
text++;
}
if (!*text)
break;
count++;
text++;
}
return count;
}

3
util.h
View File

@ -50,9 +50,6 @@ char *get_arg(char **text);
void debug_hexdump(const char *label,
const uint8_t *data, int len);
/* Get text length, not including ANSI codes */
int textlen(const char *text);
static inline int ishex(int c)
{
return isdigit(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f');