--- aspell-0.50.3.orig/prog/aspell.cpp +++ aspell-0.50.3/prog/aspell.cpp @@ -392,12 +392,16 @@ char * trim_wspace (char * str) { + if (strlen(str) <= 1) + return str; + unsigned int last = strlen(str) - 1; while (isspace(str[0])) { ++str; --last; } - while (isspace(str[last])) { + while (last != 0 && isspace(str[last])) { str[last] = '\0'; --last; }