Skip to content

Commit

Permalink
avoid using negative array index in readConfigFile()
Browse files Browse the repository at this point in the history
Closes #33
  • Loading branch information
kdudka committed Dec 12, 2016
1 parent 5241769 commit f53ed9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config.c
Expand Up @@ -1018,9 +1018,9 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
!strcmp(key, "maxsize")) {
unsigned long long size = 0;
char *opt = key;
if ((key = isolateValue(configFile, lineNum, opt, &start,
&buf, length)) != NULL) {

key = isolateValue(configFile, lineNum, opt, &start, &buf, length);
if (key && key[0]) {
int l = strlen(key) - 1;
if (key[l] == 'k' || key[l] == 'K') {
key[l] = '\0';
Expand Down

0 comments on commit f53ed9c

Please sign in to comment.