Skip to content

Commit 00154dc

Browse files
committed
Updated fseek functions.
1 parent 33346b1 commit 00154dc

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AC_PREREQ(2.59)
22

3-
AC_INIT([IP2Proxy], [4.0.0])
3+
AC_INIT([IP2Proxy], [4.0.1])
44
AC_CONFIG_SRCDIR([libIP2Proxy/IP2Proxy.c])
55
AM_INIT_AUTOMAKE
66

libIP2Proxy/IP2Proxy.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ int32_t IP2Proxy_set_shared_memory(FILE *file)
10561056
// Load BIN file into memory
10571057
int32_t IP2Proxy_load_database_into_memory(FILE *file, void *memory, int64_t size)
10581058
{
1059-
fseek(file, SEEK_SET, 0);
1059+
fseek(file, 0, SEEK_SET);
10601060

10611061
if (fread(memory, size, 1, file) != 1) {
10621062
return -1;
@@ -1216,7 +1216,7 @@ uint32_t IP2Proxy_read32(FILE *handle, uint32_t position)
12161216

12171217
// Read from file
12181218
if (lookup_mode == IP2PROXY_FILE_IO && handle != NULL) {
1219-
fseek(handle, position - 1, 0);
1219+
fseek(handle, position - 1, SEEK_SET);
12201220
temp = fread(&byte1, 1, 1, handle);
12211221

12221222
if (temp == 0) {
@@ -1257,7 +1257,7 @@ uint8_t IP2Proxy_read8(FILE *handle, uint32_t position)
12571257
size_t temp;
12581258

12591259
if (lookup_mode == IP2PROXY_FILE_IO && handle != NULL) {
1260-
fseek(handle, position - 1, 0);
1260+
fseek(handle, position - 1, SEEK_SET);
12611261
temp = fread(&ret, 1, 1, handle);
12621262

12631263
if (temp == 0) {
@@ -1315,7 +1315,7 @@ float IP2Proxy_read_float(FILE *handle, uint32_t position)
13151315

13161316
// for SUN SPARC, have to reverse the byte order
13171317
if (lookup_mode == IP2PROXY_FILE_IO && handle != NULL) {
1318-
fseek(handle, position - 1, 0);
1318+
fseek(handle, position - 1, SEEK_SET);
13191319

13201320
temp = fread(p + 3, 1, 1, handle);
13211321

@@ -1348,7 +1348,7 @@ float IP2Proxy_read_float(FILE *handle, uint32_t position)
13481348
}
13491349
#else
13501350
if (lookup_mode == IP2PROXY_FILE_IO && handle != NULL) {
1351-
fseek(handle, position - 1, 0);
1351+
fseek(handle, position - 1, SEEK_SET);
13521352
temp = fread(&ret, 4, 1, handle);
13531353

13541354
if (temp == 0) {

libIP2Proxy/IP2Proxy.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ extern "C" {
5454
#endif
5555
#endif
5656

57-
#define API_VERSION 4.0.0
57+
#define API_VERSION 4.0.1
5858
#define API_VERSION_MAJOR 4
5959
#define API_VERSION_MINOR 0
60-
#define API_VERSION_RELEASE 0
60+
#define API_VERSION_RELEASE 1
6161
#define API_VERSION_NUMERIC (((API_VERSION_MAJOR * 100) + API_VERSION_MINOR) * 100 + API_VERSION_RELEASE)
6262

6363
#define MAX_IPV4_RANGE 4294967295U

0 commit comments

Comments
 (0)