Skip to content

Commit d7a6558

Browse files
committed
minor compilation fixes
1 parent f1d1805 commit d7a6558

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/infoLoggerD.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ int checkDirAndCreate(const char* dir, SimpleLog* log = NULL)
147147
}
148148

149149
// check directory tree
150-
int i, j;
150+
unsigned int i, j;
151151
for (i = strlen(dir); i >= 0; i--) {
152152
if (dir[i] == '/') {
153153
if (i > 0) {
@@ -158,6 +158,9 @@ int checkDirAndCreate(const char* dir, SimpleLog* log = NULL)
158158
break;
159159
}
160160
}
161+
if (i >= PATH_MAX) {
162+
return -1;
163+
}
161164
for (j = 0; j < i; j++) {
162165
path[j] = dir[j];
163166
}

test/testInfoLogger.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
#include <InfoLogger/InfoLogger.h>
1717

18-
#define _BSD_SOURCE
19-
2018
#include <stdio.h>
2119
#include <unistd.h>
2220

test/testInfoLoggerDB.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <string.h>
1616
#include <sys/types.h>
1717
#include <unistd.h>
18+
#include <time.h>
1819

1920
#if LIBMYSQL_VERSION_ID >= 80000
2021
typedef bool my_bool;

0 commit comments

Comments
 (0)