aboutsummaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorFranklin Wei <franklin@fwei.tk>2014-06-23 11:47:32 -0400
committerFranklin Wei <franklin@fwei.tk>2014-06-23 11:47:32 -0400
commit719be73360ebf8a65038a90ea82ea4e290759df1 (patch)
tree73c279e4ef5b1939372225ce051c04d73a9e8227 /util.c
parent2f67051c045ed026d949d8578235b4f5a7fa4af5 (diff)
downloadwargames-server-719be73360ebf8a65038a90ea82ea4e290759df1.zip
wargames-server-719be73360ebf8a65038a90ea82ea4e290759df1.tar.gz
wargames-server-719be73360ebf8a65038a90ea82ea4e290759df1.tar.bz2
wargames-server-719be73360ebf8a65038a90ea82ea4e290759df1.tar.xz
Fixed GTN
Diffstat (limited to 'util.c')
-rw-r--r--util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/util.c b/util.c
index 8781739..ef4b62d 100644
--- a/util.c
+++ b/util.c
@@ -1,5 +1,6 @@
#include <util.h>
#include <curses.h>
+#include "strings.h"
void allLower(char* str)
{
for(int i=0;str[i];++i)
@@ -18,3 +19,16 @@ void print_string(const char* str) /* print string, slowly */
++i;
}
}
+void remove_punct(char* buf)
+{
+ for(int i=0;buf[i];++i)
+ {
+ for(int j=0;j<sizeof(punctuation_marks)/sizeof(char);++j)
+ {
+ if(buf[i]==punctuation_marks[j])
+ {
+ memmove(&buf[i], &buf[i+1], strlen(buf)-i);
+ }
+ }
+ }
+}