From 70f4c55c8af75f6be71de7a62e7e24266f4694e2 Mon Sep 17 00:00:00 2001 From: aixiao Date: Sun, 30 Jun 2019 11:01:17 +0800 Subject: [PATCH] Repair the getinikeystring() function --- libini.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libini.c b/libini.c index 80b0a26..1b082e1 100644 --- a/libini.c +++ b/libini.c @@ -20,15 +20,14 @@ int getinikeystring(char *title, char *key, char *filename, char *buf) while (NULL != fgets(sLine, BUFFER_SIZE, fp)) { if (0 == strncmp("//", sLine, 2)) continue; - if ('#' == sLine[0]) + if (0 == strncmp("#", sLine, 1)) continue; - if (';' == sLine[0]) + if (0 == strncmp(";", sLine, 1)) continue; wTmp = strchr(sLine, '='); if ((NULL != wTmp) && (1 == flag)) { sLine[strlen(sLine) - 1] = '\0'; if (0 == strncmp(key, sLine, strlen(key)) && !(strncasecmp(strtok(sLine, "="), key, strlen(strtok(sLine, "="))))) { - //printf("%s\n", sLine); fclose(fp); while (*(wTmp + 1) == ' ') { wTmp++;