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
a7999da3
Commit
a7999da3
authored
11 years ago
by
Steve Holme
Browse files
Options
Downloads
Patches
Plain Diff
tool_getparam.c: Fixed compilation warnings
There is an implicit conversion from "unsigned long" to "long"
parent
415c982a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/warnless.c
+19
-0
19 additions, 0 deletions
lib/warnless.c
lib/warnless.h
+2
-0
2 additions, 0 deletions
lib/warnless.h
src/tool_getparam.c
+2
-2
2 additions, 2 deletions
src/tool_getparam.c
with
23 additions
and
2 deletions
lib/warnless.c
+
19
−
0
View file @
a7999da3
...
...
@@ -174,6 +174,25 @@ int curlx_ultosi(unsigned long ulnum)
#endif
}
/*
** unsigned size_t to signed curl_off_t
*/
curl_off_t
curlx_uztoso
(
size_t
uznum
)
{
#ifdef __INTEL_COMPILER
# pragma warning(push)
# pragma warning(disable:810)
/* conversion may lose significant bits */
#endif
DEBUGASSERT
(
uznum
<=
(
size_t
)
CURL_MASK_SCOFFT
);
return
(
curl_off_t
)(
uznum
&
(
size_t
)
CURL_MASK_SCOFFT
);
#ifdef __INTEL_COMPILER
# pragma warning(pop)
#endif
}
/*
** unsigned size_t to signed int
*/
...
...
This diff is collapsed.
Click to expand it.
lib/warnless.h
+
2
−
0
View file @
a7999da3
...
...
@@ -34,6 +34,8 @@ int curlx_ultosi(unsigned long ulnum);
int
curlx_uztosi
(
size_t
uznum
);
curl_off_t
curlx_uztoso
(
size_t
uznum
);
unsigned
long
curlx_uztoul
(
size_t
uznum
);
unsigned
int
curlx_uztoui
(
size_t
uznum
);
...
...
This diff is collapsed.
Click to expand it.
src/tool_getparam.c
+
2
−
2
View file @
a7999da3
...
...
@@ -1239,7 +1239,7 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
&-letter */
char
*
oldpost
=
config
->
postfields
;
curl_off_t
oldlen
=
config
->
postfieldsize
;
curl_off_t
newlen
=
oldlen
+
size
+
2
;
curl_off_t
newlen
=
oldlen
+
curlx_uztoso
(
size
)
+
2
;
config
->
postfields
=
malloc
((
size_t
)
newlen
);
if
(
!
config
->
postfields
)
{
Curl_safefree
(
oldpost
);
...
...
@@ -1257,7 +1257,7 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
}
else
{
config
->
postfields
=
postdata
;
config
->
postfieldsize
=
size
;
config
->
postfieldsize
=
curlx_uztoso
(
size
)
;
}
}
/*
...
...
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