From 93c3cb342bc1002ca6623a7905c576110aa75034 Mon Sep 17 00:00:00 2001 From: Daniel Beer Date: Tue, 17 Aug 2010 10:22:16 +1200 Subject: [PATCH] Remove redundant textlen() function. --- util.c | 22 ---------------------- util.h | 3 --- 2 files changed, 25 deletions(-) diff --git a/util.c b/util.c index bc66018..171f453 100644 --- a/util.c +++ b/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; -} diff --git a/util.h b/util.h index 210a36c..d8067dc 100644 --- a/util.h +++ b/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');