mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 04:45:58 +01:00
util/env: make env_parse_switch() return a size_t
This function is guaranteed to never return a negative value. This is important because we use arr[env_parse_switch(...)] in a few places.
This commit is contained in:
parent
dc09585d14
commit
d72b4409ce
2 changed files with 2 additions and 2 deletions
|
@ -18,6 +18,6 @@ bool env_parse_bool(const char *option);
|
||||||
*
|
*
|
||||||
* switches is a NULL-terminated array.
|
* switches is a NULL-terminated array.
|
||||||
*/
|
*/
|
||||||
ssize_t env_parse_switch(const char *option, const char **switches);
|
size_t env_parse_switch(const char *option, const char **switches);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -19,7 +19,7 @@ bool env_parse_bool(const char *option) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t env_parse_switch(const char *option, const char **switches) {
|
size_t env_parse_switch(const char *option, const char **switches) {
|
||||||
const char *env = getenv(option);
|
const char *env = getenv(option);
|
||||||
if (env) {
|
if (env) {
|
||||||
wlr_log(WLR_INFO, "Loading %s option: %s", option, env);
|
wlr_log(WLR_INFO, "Loading %s option: %s", option, env);
|
||||||
|
|
Loading…
Reference in a new issue