Skip to content

Commit

Permalink
Make dir_name_buf no longer than _TINYDIR_FILENAME_MAX
Browse files Browse the repository at this point in the history
Like the previous commit, _splitpath_s may not work fine with too long buffer of parameters.
Refer to https://msdn.microsoft.com/en-us/library/8e46eyt7.aspx#Anchor_3
  • Loading branch information
lautis0503 authored Sep 7, 2016
1 parent d4d5eb2 commit 637c79e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tinydir.h
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ int tinydir_file_open(tinydir_file *file, const _tinydir_char_t *path)
_tsplitpath_s(
path,
drive_buf, _TINYDIR_DRIVE_MAX,
dir_name_buf, _TINYDIR_PATH_MAX,
dir_name_buf, _TINYDIR_FILENAME_MAX,
file_name_buf, _TINYDIR_FILENAME_MAX,
ext_buf, sizeof _TINYDIR_FILENAME_MAX);
#else
Expand Down

0 comments on commit 637c79e

Please sign in to comment.