From 873c7d93b69128475ae96d6dedf986f501cff359 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Sat, 27 Aug 2022 12:22:03 +0200 Subject: [PATCH] Fix ffStrSet --- src/common/parsing.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/common/parsing.c b/src/common/parsing.c index e76029f65..015235952 100644 --- a/src/common/parsing.c +++ b/src/common/parsing.c @@ -1,5 +1,6 @@ #include "fastfetch.h" #include "common/parsing.h" +#include #include bool ffStrSet(const char* str) @@ -7,13 +8,10 @@ bool ffStrSet(const char* str) if(str == NULL) return false; - while(*str != '\0') - { - if(*str != ' ' && *str != '\t' && *str != '\n' && *str != '\r') - return true; - } + while(isspace(*str)) + str++; - return false; + return *str != '\0'; } void ffParseSemver(FFstrbuf* buffer, const FFstrbuf* major, const FFstrbuf* minor, const FFstrbuf* patch)