Remove redundant textlen() function.
This commit is contained in:
parent
30c3d8e6f1
commit
93c3cb342b
22
util.c
22
util.c
|
@ -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
3
util.h
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue