X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/e14c018cf2ab33de117b0462e30d4128de7060c3..39b352321e40d267678d02d13ab6de1e1e4958c6:/onak-conf.c diff --git a/onak-conf.c b/onak-conf.c index 81d7bdf..f97197c 100644 --- a/onak-conf.c +++ b/onak-conf.c @@ -60,9 +60,11 @@ void readconfig(const char *configfile) { fgets(curline, 1023, conffile); while (!feof(conffile)) { - for (i = strlen(curline) - 1; isspace(curline[i]); i--) { - curline[i] = 0; - } + for (i = strlen(curline) - 1; + i >= 0 && isspace(curline[i]); + i--) { + curline[i] = 0; + } if (curline[0] == '#' || curline[0] == 0) { /*