create 2nd strschg_environ(): one with control length of string, second without this check

This commit is contained in:
Stas Degteff 2011-02-17 21:35:21 +00:00
parent 75e84ece09
commit 0119f9a971

View File

@ -443,7 +443,20 @@ int strschg_environ(char* s) {
std::string __s = s;
int rv = strschg_environ(__s); // Look in gfilutl2.cpp
if(rv)
strxcpy(s, __s.c_str(), sizeof(Path));
strcpy(s, __s.c_str());
return rv;
}
int strschg_environ(char* s, size_t s_size) {
if(s == NULL) return 0;
if(*s == NUL)
return 0;
std::string __s = s;
int rv = strschg_environ(__s); // Look in gfilutl2.cpp
if(rv)
strxcpy(s, __s.c_str(), s_size);
return rv;
}