Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
2e1e0990
Commit
2e1e0990
authored
Apr 29, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use strncpy() rather than strncat() when the destination is empty
parent
30cc7cca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
modules/access/smb.c
modules/access/smb.c
+4
-6
No files found.
modules/access/smb.c
View file @
2e1e0990
...
@@ -457,17 +457,15 @@ static void Win32AddConnection( access_t *p_access, char *psz_path,
...
@@ -457,17 +457,15 @@ static void Win32AddConnection( access_t *p_access, char *psz_path,
net_resource
.
dwType
=
RESOURCETYPE_DISK
;
net_resource
.
dwType
=
RESOURCETYPE_DISK
;
/* Find out server and share names */
/* Find out server and share names */
psz_server
[
0
]
=
psz_share
[
0
]
=
0
;
strncpy
(
psz_server
,
psz_path
,
sizeof
(
psz_server
)
);
psz_share
[
0
]
=
0
;
psz_parser
=
strchr
(
psz_path
,
'/'
);
psz_parser
=
strchr
(
psz_path
,
'/'
);
if
(
psz_parser
)
if
(
psz_parser
)
{
{
char
*
psz_parser2
;
char
*
psz_parser2
=
strchr
(
++
psz_parser
,
'/'
);
strncat
(
psz_server
,
psz_path
,
psz_parser
-
psz_path
);
psz_parser2
=
strchr
(
psz_parser
+
1
,
'/'
);
if
(
psz_parser2
)
if
(
psz_parser2
)
strnc
at
(
psz_share
,
psz_parser
+
1
,
psz_parser2
-
psz_parser
-
1
);
strnc
py
(
psz_share
,
psz_parser
,
sizeof
(
psz_share
)
);
}
}
else
strncat
(
psz_server
,
psz_path
,
MAX_PATH
);
sprintf
(
psz_remote
,
"
\\\\
%s
\\
%s"
,
psz_server
,
psz_share
);
sprintf
(
psz_remote
,
"
\\\\
%s
\\
%s"
,
psz_server
,
psz_share
);
net_resource
.
lpRemoteName
=
psz_remote
;
net_resource
.
lpRemoteName
=
psz_remote
;
...
...
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