summaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/misc.c b/src/misc.c
index 73d6070..f2b713f 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -99,6 +99,19 @@ void strlist_free(struct strlist **list)
}
}
+void clean_text(char *text, int vwidth)
+{
+ int i = 0;
+ if(textwidth(text) > vwidth){
+ text[textwidthx(text, vwidth)] = 0;
+ }
+ for(i = 0; i < strlen(text); i++){
+ if(! (text[i]>=' ' && text[i]<127)){
+ text[i] = ' ';
+ }
+ }
+}
+
void save_presets(int do_update)
{
FILE *f=fopen("powder.def", "wb");