Accuracy, not strong test length of string in strschg_environ

This commit is contained in:
Stas Degteff 2011-02-17 15:37:30 +00:00
parent ed63c97cc0
commit bc54b3f3b3

View File

@ -95,7 +95,7 @@ int strschg_environ(std::string& s) {
const char *p = s.c_str()+1;
struct passwd *pe=NULL;
if((s.length() != 1) and not isslash(*p)) {
if((s.length() > 1) and not isslash(*p)) {
while(*p and not isslash(*p))
name += *p++;
pe = getpwnam(name.c_str());