aboutsummaryrefslogtreecommitdiffstats
path: root/cap.c
diff options
context:
space:
mode:
Diffstat (limited to 'cap.c')
-rw-r--r--cap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cap.c b/cap.c
index d985e91..c36732d 100644
--- a/cap.c
+++ b/cap.c
@@ -14,8 +14,9 @@
char *capitalise(char *string)
{
+ size_t length = strlen(string);
bool last_sep = true; /* Nothing is a separator too. */
- for (int i = 0; i < strlen(string); i++) {
+ for (unsigned i = 0; i < length; i++) {
if (isalpha(string[i])) {
string[i] = last_sep ? toupper(string[i]) : tolower(string[i]);
last_sep = false;