mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-15 00:38:15 +00:00
Merge pull request #671 from seanm/getDebugLevel
Fix getDebugLevel handling of empty environment variable value
This commit is contained in:
commit
7ca7dbe24a
1 changed files with 1 additions and 1 deletions
|
@ -8396,7 +8396,7 @@ getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) {
|
|||
errno = 0;
|
||||
char *afterValue = (char *)value;
|
||||
unsigned long debugLevel = strtoul(value, &afterValue, 10);
|
||||
if ((errno != 0) || (afterValue[0] != '\0')) {
|
||||
if ((errno != 0) || (afterValue == value) || (afterValue[0] != '\0')) {
|
||||
errno = 0;
|
||||
return defaultDebugLevel;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue