You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Break a path name into components. More secure versions of these functions are available, see [`_splitpath_s`, `_wsplitpath_s`](splitpath-s-wsplitpath-s.md).
14
+
Break a path into components. For more secure versions of these functions are available, see [`_splitpath_s`, `_wsplitpath_s`](splitpath-s-wsplitpath-s.md).
16
15
17
16
## Syntax
18
17
@@ -42,19 +41,19 @@ Full path.
42
41
Drive letter, followed by a colon (**:**). You can pass `NULL` for this parameter if you don't need the drive letter.
43
42
44
43
*`dir`*\
45
-
Directory path, including trailing slash. Forward slashes ( **/** ), backslashes ( **\\** ), or both may be used. You can pass`NULL` for this parameter if you don't need the directory path.
44
+
Directory path, including trailing slash. Forward slashes ( `/` ), backslashes ( `\` ), or both may be used. Pass`NULL` for this parameter if you don't need the directory path.
46
45
47
46
*`fname`*\
48
-
Base filename (no extension). You can pass`NULL` for this parameter if you don't need the filename.
47
+
Base filename (no extension). Pass`NULL` for this parameter if you don't need the filename.
49
48
50
49
*`ext`*\
51
-
Filename extension, including leading period (**.**). You can pass`NULL` for this parameter if you don't need the filename extension.
50
+
Filename extension, including leading period (`.`). Pass`NULL` for this parameter if you don't need the filename extension.
52
51
53
52
## Remarks
54
53
55
54
The **`_splitpath`** function breaks a path into its four components. **`_splitpath`** automatically handles multibyte-character string arguments as appropriate, recognizing multibyte-character sequences according to the multibyte code page currently in use. **`_wsplitpath`** is a wide-character version of **`_splitpath`**; the arguments to **`_wsplitpath`** are wide-character strings. These functions behave identically otherwise.
56
55
57
-
**Security Note** These functions incur a potential threat brought about by a buffer overrun problem. Buffer overrun problems are a frequent method of system attack, resulting in an unwarranted elevation of privilege. For more information, see [Avoiding buffer overruns](/windows/win32/SecBP/avoiding-buffer-overruns). More secure versions of these functions are available; see [`_splitpath_s`, `_wsplitpath_s`](splitpath-s-wsplitpath-s.md).
56
+
**Security Note** These functions are subject to buffer overrun. Buffer overrun problems are a frequent method of system attack, resulting in an unwarranted elevation of privilege. For more information, see [Avoiding buffer overruns](/windows/win32/SecBP/avoiding-buffer-overruns). More secure versions of these functions are available; see [`_splitpath_s`, `_wsplitpath_s`](splitpath-s-wsplitpath-s.md).
58
57
59
58
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
60
59
@@ -81,7 +80,7 @@ If the full path doesn't contain a component (for example, a filename), **`_spli
81
80
82
81
You can pass `NULL` to **`_splitpath`** for any parameter other than *`path`* that you don't need.
83
82
84
-
If *`path`* is `NULL`, the invalid parameter handler is invoked, as described in [Parameter validation](../parameter-validation.md). If execution is allowed to continue, `errno` is set to `EINVAL` and the function returns `EINVAL`.
83
+
If *`path`* is `NULL`, the invalid parameter handler is invoked, as described in [Parameter validation](../parameter-validation.md). If execution is allowed to continue, `errno` is set to `EINVAL`.
0 commit comments