Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
8c95808d
Commit
8c95808d
authored
May 16, 2022
by
Rob Swindell
💬
Browse files
Borland didn't include inet_ntop() or inet_pton()
Fixes CI and nightly build.
parent
0eb0f451
Pipeline
#3035
failed with stage
in 9 minutes and 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
src/xpdev/ini_file.c
src/xpdev/ini_file.c
+13
-2
No files found.
src/xpdev/ini_file.c
View file @
8c95808d
...
...
@@ -719,7 +719,13 @@ char* iniSetIpAddress(str_list_t* list, const char* section, const char* key, ui
char
buf
[
128
];
struct
in_addr
in_addr
;
in_addr
.
s_addr
=
htonl
(
value
);
return
iniSetString
(
list
,
section
,
key
,
inet_ntop
(
AF_INET
,
&
in_addr
,
buf
,
sizeof
(
buf
)),
style
);
return
iniSetString
(
list
,
section
,
key
,
#ifdef __BORLANDC__
inet_ntoa
(
in_addr
),
// deprecated function call
#else
inet_ntop
(
AF_INET
,
&
in_addr
,
buf
,
sizeof
(
buf
)),
#endif
style
);
}
char
*
iniSetIp6Address
(
str_list_t
*
list
,
const
char
*
section
,
const
char
*
key
,
struct
in6_addr
value
...
...
@@ -1633,11 +1639,16 @@ int iniGetSocketOptions(str_list_t list, const char* section, SOCKET sock
static
uint32_t
parseIpAddress
(
const
char
*
value
)
{
uint32_t
result
=
0
;
if
(
strchr
(
value
,
'.'
)
==
NULL
)
return
(
strtol
(
value
,
NULL
,
0
));
uint32_t
result
=
0
;
#ifdef __BORLANDC__
result
=
inet_addr
(
value
);
// deprecated function call
#else
inet_pton
(
AF_INET
,
value
,
&
result
);
#endif
return
ntohl
(
result
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment