Skip to content

Commit

Permalink
* win32/win32.c: get rid of STRNDUPA(). It's dangerous API.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
kosaki committed Jan 27, 2011
1 parent 2529d2c commit 8d397b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Thu Jan 27 21:41:47 2011 KOSAKI Motohiro <[email protected]>

* win32/win32.c: get rid of STRNDUPA(). It's dangerous API.

Thu Jan 27 21:31:57 2011 KOSAKI Motohiro <[email protected]>

* win32/win32.c (rb_w32_aspawn): get rid of too huge alloca().
Expand Down
3 changes: 0 additions & 3 deletions win32/win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,9 +966,6 @@ join_argv(char *cmd, char *const *argv, BOOL escape)
# define MAXPATHLEN 512
#endif

#define STRNDUPA(ptr, src, len) \
(((char *)memcpy(((ptr) = ALLOCA_N(char, (len) + 1)), (src), (len)))[len] = 0)

#define STRNDUPV(ptr, v, src, len) \
(((char *)memcpy(((ptr) = ALLOCV((v), (len) + 1)), (src), (len)))[len] = 0)

Expand Down

0 comments on commit 8d397b7

Please sign in to comment.