We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac221b3 commit 8e0ad47Copy full SHA for 8e0ad47
compat/winansi.c
@@ -478,7 +478,6 @@ static HANDLE duplicate_handle(HANDLE hnd)
478
#if defined(_MSC_VER)
479
static HANDLE swap_osfhnd(int fd, HANDLE new_handle)
480
{
481
- assert((fd == 1) || (fd == 2));
482
DWORD key_std = ((fd == 1) ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE);
483
484
/*
@@ -491,6 +490,8 @@ static HANDLE swap_osfhnd(int fd, HANDLE new_handle)
491
490
/* Create a temp fd associated with the already open "new_handle". */
492
int fd_temp = _open_osfhandle((intptr_t)new_handle, O_BINARY);
493
+ assert((fd == 1) || (fd == 2));
494
+
495
496
* Use stock dup2() to re-bind fd to the new handle. Note that
497
* this will implicitly close(1) and close both fd=1 and the
0 commit comments