Merge pull request #7774 from ggouaillardet/topic/v4.0.x/opal_str_to_bool
v3.0: opal/util: fix opal_str_to_bool()
Этот коммит содержится в:
Коммит
6dae117cff
@ -14,8 +14,8 @@
|
|||||||
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2012-2017 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2012-2017 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2015-2017 Research Organization for Information Science
|
* Copyright (c) 2015-2020 Research Organization for Information Science
|
||||||
* and Technology (RIST). All rights reserved.
|
* and Technology (RIST). All rights reserved.
|
||||||
* Copyright (c) 2016-2018 IBM Corporation. All rights reserved.
|
* Copyright (c) 2016-2018 IBM Corporation. All rights reserved.
|
||||||
* Copyright (c) 2017 Intel, Inc. All rights reserved.
|
* Copyright (c) 2017 Intel, Inc. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
@ -370,13 +370,13 @@ opal_str_to_bool(char *str)
|
|||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
||||||
/* Trim whitespace */
|
/* Trim whitespace */
|
||||||
ptr = str + sizeof(str) - 1;
|
ptr = str + strlen(str) - 1;
|
||||||
while (ptr >= str && isspace(*ptr)) {
|
while (ptr >= str && isspace(*ptr)) {
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
--ptr;
|
--ptr;
|
||||||
}
|
}
|
||||||
ptr = str;
|
ptr = str;
|
||||||
while (ptr < str + sizeof(str) - 1 && *ptr != '\0' &&
|
while (ptr < str + strlen(str) - 1 && *ptr != '\0' &&
|
||||||
isspace(*ptr)) {
|
isspace(*ptr)) {
|
||||||
++ptr;
|
++ptr;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user