do some clang static analysis

also fix readline