summaryrefslogtreecommitdiff
path: root/functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'functions.c')
-rw-r--r--functions.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/functions.c b/functions.c
index 8bbc213..938b8b1 100644
--- a/functions.c
+++ b/functions.c
@@ -1253,3 +1253,12 @@ int getclientcodetime(char *code, struct clientcodes *clientcodes) {
// If we got here, the code was never found
return 0;
}
+
+// Replace any instances of "find" with "replace" in the string "str"
+void replacechar(char *str, char find, char replace) {
+ for (size_t i = 0; i < strlen(str); i++) {
+ if (str[i] == find) {
+ str[i] = replace;
+ }
+ }
+}