1
1

Merge pull request #7773 from ggouaillardet/topic/opal_str_to_bool

opal/util: fix opal_str_to_bool()
Этот коммит содержится в:
Gilles Gouaillardet 2020-06-01 10:15:16 +09:00 коммит произвёл GitHub
родитель d5c4f6b92a c450b21405
Коммит 1036eca117
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23

Просмотреть файл

@ -14,8 +14,8 @@
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2012-2017 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015-2020 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016-2018 IBM Corporation. All rights reserved.
* Copyright (c) 2017-2020 Intel, Inc. All rights reserved.
* $COPYRIGHT$
@ -359,13 +359,13 @@ opal_str_to_bool(char *str)
char *ptr;
/* Trim whitespace */
ptr = str + sizeof(str) - 1;
ptr = str + strlen(str) - 1;
while (ptr >= str && isspace(*ptr)) {
*ptr = '\0';
--ptr;
}
ptr = str;
while (ptr < str + sizeof(str) - 1 && *ptr != '\0' &&
while (ptr < str + strlen(str) - 1 && *ptr != '\0' &&
isspace(*ptr)) {
++ptr;
}