aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 22ed7b4..e2e7d35 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -45,4 +45,16 @@ Image colorsToImage(Color* colors, int width, int height)
};
}
+size_t getStringLength(const char* text, size_t maxLength)
+{
+ size_t stringLength = 0;
+
+ while (stringLength < maxLength && text[stringLength] != '\0')
+ {
+ ++stringLength;
+ }
+
+ return stringLength;
+}
+
// Why does the universe feel strange to exist in?