Changeset 2e1e0990567db4bd21567f830a8dfd4f027ddca3
- Timestamp:
- 29/04/06 15:38:50
(3 years ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1146317930 +0000
- git-parent:
[30cc7ccac0a7f593b1f4c8247f231fcd8167618b]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1146317930 +0000
- Message:
Use strncpy() rather than strncat() when the destination is empty
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r4f15591 |
r2e1e099 |
|
| 458 | 458 | |
|---|
| 459 | 459 | /* Find out server and share names */ |
|---|
| 460 | | psz_server[0] = psz_share[0] = 0; |
|---|
| | 460 | strncpy( psz_server, psz_path, sizeof( psz_server ) ); |
|---|
| | 461 | psz_share[0] = 0; |
|---|
| 461 | 462 | psz_parser = strchr( psz_path, '/' ); |
|---|
| 462 | 463 | if( psz_parser ) |
|---|
| 463 | 464 | { |
|---|
| 464 | | char *psz_parser2; |
|---|
| 465 | | strncat( psz_server, psz_path, psz_parser - psz_path ); |
|---|
| 466 | | psz_parser2 = strchr( psz_parser+1, '/' ); |
|---|
| | 465 | char *psz_parser2 = strchr( ++psz_parser, '/' ); |
|---|
| 467 | 466 | if( psz_parser2 ) |
|---|
| 468 | | strncat( psz_share, psz_parser+1, psz_parser2 - psz_parser -1 ); |
|---|
| 469 | | } |
|---|
| 470 | | else strncat( psz_server, psz_path, MAX_PATH ); |
|---|
| | 467 | strncpy( psz_share, psz_parser, sizeof( psz_share ) ); |
|---|
| | 468 | } |
|---|
| 471 | 469 | |
|---|
| 472 | 470 | sprintf( psz_remote, "\\\\%s\\%s", psz_server, psz_share ); |
|---|