summaryrefslogtreecommitdiff
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-07-18 21:43:02 +0000
committerBram Moolenaar <Bram@vim.org>2005-07-18 21:43:02 +0000
commitfe3ca8ddd9b85240387b6fa7934af3317e25b731 (patch)
treec855bb725bd10a5a00670bdd43218dfc17041832 /src/os_win32.c
parentb635633989f0ff5a5dbb564d65d332741f0e3e8d (diff)
downloadvim-git-fe3ca8ddd9b85240387b6fa7934af3317e25b731.tar.gz
updated for version 7.0109
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index 6ad674e2d..c2d5ebbd7 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2356,7 +2356,7 @@ mch_get_user_name(
if (GetUserName(szUserName, &cch))
{
- STRNCPY(s, szUserName, len);
+ vim_strncpy(s, szUserName, len - 1);
return OK;
}
s[0] = NUL;
@@ -2375,10 +2375,7 @@ mch_get_host_name(
DWORD cch = len;
if (!GetComputerName(s, &cch))
- {
- STRNCPY(s, "PC (Win32 Vim)", len);
- s[len - 1] = NUL; /* make sure it's terminated */
- }
+ vim_strncpy(s, "PC (Win32 Vim)", len - 1);
}
@@ -2418,8 +2415,7 @@ mch_dirname(
if (p != NULL)
{
- STRNCPY(buf, p, len - 1);
- buf[len - 1] = NUL;
+ vim_strncpy(buf, p, len - 1);
vim_free(p);
return OK;
}
@@ -2591,7 +2587,7 @@ mch_can_exe(char_u *name)
/*
* Loop over all extensions in $PATHEXT.
*/
- STRNCPY(buf, name, _MAX_PATH);
+ vim_strncpy(buf, name, _MAX_PATH - 1);
p = mch_getenv("PATHEXT");
if (p == NULL)
p = (char_u *)".com;.exe;.bat;.cmd";
@@ -4452,7 +4448,7 @@ mch_access(char *n, int p)
char *pch;
WIN32_FIND_DATA d;
- STRNCPY(TempName, n, _MAX_PATH);
+ vim_strncpy(TempName, n, _MAX_PATH);
pch = TempName + STRLEN(TempName) - 1;
if (*pch != '\\' && *pch != '/')
*++pch = '\\';