From c4b3bf06c64712aa83ae13b617fc3e48933945cf Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 8 Sep 2005 18:33:51 +0000 Subject: [PATCH] add strupper function svn:r4934 --- src/common/util.c | 10 ++++++++++ src/common/util.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/common/util.c b/src/common/util.c index 67d62aeddb..8f908fdf4e 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -299,6 +299,16 @@ void tor_strlower(char *s) } } +/** Convert all alphabetic characters in the nul-terminated string s to + * lowercase. */ +void tor_strupper(char *s) +{ + while (*s) { + *s = toupper(*s); + ++s; + } +} + /* Compares the first strlen(s2) characters of s1 with s2. Returns as for * strcmp. */ diff --git a/src/common/util.h b/src/common/util.h index eb39fd008a..d2a0051ceb 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -69,6 +69,7 @@ char *_tor_strndup(const char *file, const int line, const char *s, size_t n); /* String manipulation */ #define HEX_CHARACTERS "0123456789ABCDEFabcdef" void tor_strlower(char *s); +void tor_strupper(char *s); int strcmpstart(const char *s1, const char *s2); int strcasecmpstart(const char *s1, const char *s2); int strcmpend(const char *s1, const char *s2);