Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
e4adbf40
Commit
e4adbf40
authored
21 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
Dominick Meglio fixed this to build fine on MSVC
parent
c29740f0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/inet_pton.c
+16
-10
16 additions, 10 deletions
lib/inet_pton.c
with
16 additions
and
10 deletions
lib/inet_pton.c
+
16
−
10
View file @
e4adbf40
...
...
@@ -20,6 +20,11 @@
#ifndef HAVE_INET_PTON
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
#define EAFNOSUPPORT WSAEAFNOSUPPORT
#include
<winsock.h>
#else
#ifdef HAVE_SYS_PARAM_H
#include
<sys/param.h>
#endif
...
...
@@ -35,6 +40,7 @@
#ifdef HAVE_ARPA_INET_H
#include
<arpa/inet.h>
#endif
#endif
#include
<string.h>
#include
<errno.h>
...
...
@@ -51,8 +57,8 @@
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
*/
static
int
inet_pton4
(
const
char
*
src
,
u
_
char
*
dst
);
static
int
inet_pton6
(
const
char
*
src
,
u
_
char
*
dst
);
static
int
inet_pton4
(
const
char
*
src
,
u
nsigned
char
*
dst
);
static
int
inet_pton6
(
const
char
*
src
,
u
nsigned
char
*
dst
);
/* int
* inet_pton(af, src, dst)
...
...
@@ -96,11 +102,11 @@ Curl_inet_pton(af, src, dst)
static
int
inet_pton4
(
src
,
dst
)
const
char
*
src
;
u
_
char
*
dst
;
u
nsigned
char
*
dst
;
{
static
const
char
digits
[]
=
"0123456789"
;
int
saw_digit
,
octets
,
ch
;
u
_
char
tmp
[
INADDRSZ
],
*
tp
;
u
nsigned
char
tmp
[
INADDRSZ
],
*
tp
;
saw_digit
=
0
;
octets
=
0
;
...
...
@@ -150,11 +156,11 @@ inet_pton4(src, dst)
static
int
inet_pton6
(
src
,
dst
)
const
char
*
src
;
u
_
char
*
dst
;
u
nsigned
char
*
dst
;
{
static
const
char
xdigits_l
[]
=
"0123456789abcdef"
,
xdigits_u
[]
=
"0123456789ABCDEF"
;
u
_
char
tmp
[
IN6ADDRSZ
],
*
tp
,
*
endp
,
*
colonp
;
u
nsigned
char
tmp
[
IN6ADDRSZ
],
*
tp
,
*
endp
,
*
colonp
;
const
char
*
xdigits
,
*
curtok
;
int
ch
,
saw_xdigit
;
u_int
val
;
...
...
@@ -192,8 +198,8 @@ inet_pton6(src, dst)
}
if
(
tp
+
INT16SZ
>
endp
)
return
(
0
);
*
tp
++
=
(
u
_
char
)
(
val
>>
8
)
&
0xff
;
*
tp
++
=
(
u
_
char
)
val
&
0xff
;
*
tp
++
=
(
u
nsigned
char
)
(
val
>>
8
)
&
0xff
;
*
tp
++
=
(
u
nsigned
char
)
val
&
0xff
;
saw_xdigit
=
0
;
val
=
0
;
continue
;
...
...
@@ -209,8 +215,8 @@ inet_pton6(src, dst)
if
(
saw_xdigit
)
{
if
(
tp
+
INT16SZ
>
endp
)
return
(
0
);
*
tp
++
=
(
u
_
char
)
(
val
>>
8
)
&
0xff
;
*
tp
++
=
(
u
_
char
)
val
&
0xff
;
*
tp
++
=
(
u
nsigned
char
)
(
val
>>
8
)
&
0xff
;
*
tp
++
=
(
u
nsigned
char
)
val
&
0xff
;
}
if
(
colonp
!=
NULL
)
{
/*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment