diff -up iniparser-4.1/src/iniparser.c.orig iniparser-4.1/src/iniparser.c --- iniparser-4.1/src/iniparser.c.orig 2017-11-02 05:09:15.000000000 -0400 +++ iniparser-4.1/src/iniparser.c 2023-06-14 11:32:33.773972538 -0400 @@ -456,7 +456,7 @@ long int iniparser_getlongint(const dict const char * str ; str = iniparser_getstring(d, key, INI_INVALID_KEY); - if (str==INI_INVALID_KEY) return notfound ; + if (str==NULL || str==INI_INVALID_KEY) return notfound ; return strtol(str, NULL, 0); } @@ -511,7 +511,7 @@ double iniparser_getdouble(const diction const char * str ; str = iniparser_getstring(d, key, INI_INVALID_KEY); - if (str==INI_INVALID_KEY) return notfound ; + if (str==NULL || str==INI_INVALID_KEY) return notfound ; return atof(str); } @@ -553,7 +553,7 @@ int iniparser_getboolean(const dictionar const char * c ; c = iniparser_getstring(d, key, INI_INVALID_KEY); - if (c==INI_INVALID_KEY) return notfound ; + if (c==NULL || c==INI_INVALID_KEY) return notfound ; if (c[0]=='y' || c[0]=='Y' || c[0]=='1' || c[0]=='t' || c[0]=='T') { ret = 1 ; } else if (c[0]=='n' || c[0]=='N' || c[0]=='0' || c[0]=='f' || c[0]=='F') {