diff --git a/ChangeLog b/ChangeLog index 525904f51..b7a149231 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-03-13 m. allan noah + * tools/sane-desc.c: remove 8859-1 chars from string cleaner, + enforce only printable ASCII on output + 2009-03-13 Ilia Sotnikov * frontend/saned.c: - Remove unnecessary 'res' variable assignment in check_host() @@ -10,11 +14,11 @@ 2009-03-12 Ilia Sotnikov * frontend/saned.c: - * Allow host checking to proceed if no local name was found + - Allow host checking to proceed if no local name was found 2009-03-12 Ilia Sotnikov * frontend/saned.c: - * Use hstrerror (h_errno) instead of strerror(errno) on gethostbyname() + - Use hstrerror (h_errno) instead of strerror(errno) on gethostbyname() errors 2009-03-12 Nicolas Martin diff --git a/tools/sane-desc.c b/tools/sane-desc.c index ee0f3cbb1..6cdd11a26 100644 --- a/tools/sane-desc.c +++ b/tools/sane-desc.c @@ -1981,6 +1981,12 @@ clean_string (char *c) while (*c != '\0') { + /*limit to printable ASCII only*/ + if(*c < 0x20 || *c > 0x7e){ + c++; + continue; + } + switch (*c) { case '<': @@ -1989,12 +1995,6 @@ clean_string (char *c) case '>': aux = strcat (aux, ">"); break; - case '¡': - aux = strcat (aux, "!"); - break; - case '¿': - aux = strcat (aux, "?"); - break; case '\'': aux = strcat (aux, "'"); break;