summaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-06-08 17:09:03 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-06-08 17:09:03 (GMT)
commit09a3670d642bbaae008790936f10e0edb704c8f0 (patch)
tree57616a9029a2d2c34379b4bb17b7b1249d2b459b /src/misc.c
parent3ea25c83b7dc039b23af2eeb4279a046fa0bf259 (diff)
downloadpowder-09a3670d642bbaae008790936f10e0edb704c8f0.zip
powder-09a3670d642bbaae008790936f10e0edb704c8f0.tar.gz
Clean up signs when reading
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");