Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
KWSys
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Martin Willers
KWSys
Commits
345d0ebe
Commit
345d0ebe
authored
15 years ago
by
Brad King
Browse files
Options
Downloads
Patches
Plain Diff
COMP: Fix KWSys SharedForward sign conversion
This uses size_t where necessary to avoid size_t/int conversion warnings.
parent
adce1c86
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SharedForward.h.in
+4
-3
4 additions, 3 deletions
SharedForward.h.in
with
4 additions
and
3 deletions
SharedForward.h.in
+
4
−
3
View file @
345d0ebe
...
...
@@ -147,6 +147,7 @@
/*--------------------------------------------------------------------------*/
/* Include needed system headers. */
#include <stddef.h> /* size_t */
#include <limits.h>
#include <stdlib.h>
#include <string.h>
...
...
@@ -550,7 +551,7 @@ static void kwsys_shared_forward_dirname(const char* begin, char* result)
else if(last_slash_index == 2 && begin[1] == ':')
{
/* Only one leading drive letter and slash. */
strncpy(result, begin, last_slash_index);
strncpy(result, begin,
(size_t)
last_slash_index);
result[last_slash_index] = KWSYS_SHARED_FORWARD_PATH_SLASH;
result[last_slash_index+1] = 0;
}
...
...
@@ -558,7 +559,7 @@ static void kwsys_shared_forward_dirname(const char* begin, char* result)
else
{
/* A non-leading slash. */
strncpy(result, begin, last_slash_index);
strncpy(result, begin,
(size_t)
last_slash_index);
result[last_slash_index] = 0;
}
}
...
...
@@ -630,7 +631,7 @@ static int kwsys_shared_forward_self_path(const char* argv0, char* result)
if(first < last)
{
/* Determine the length without trailing slash. */
in
t length = (
in
t)(last-first);
size_
t length = (
size_
t)(last-first);
if(*(last-1) == '/' || *(last-1) == '\\')
{
--length;
...
...
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