mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
common: Fix the cast for 64-bit Windows.
* common/sysutils.c (translate_sys2libc_fd_int): Fix the cast. -- FD should have a valid value here. For erroneous cases, it must be rejected by argparse handling. GnuPG-bug-id: 6551 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
3672c29156
commit
6049d61991
@ -557,17 +557,15 @@ translate_sys2libc_fd (gnupg_fd_t fd, int for_write)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* This is the same as translate_sys2libc_fd but takes an integer
|
/* This is the same as translate_sys2libc_fd but takes an integer
|
||||||
which is assumed to be such an system handle. On WindowsCE the
|
which is assumed to be such an system handle. */
|
||||||
passed FD is a rendezvous ID and the function finishes the pipe
|
|
||||||
creation. */
|
|
||||||
int
|
int
|
||||||
translate_sys2libc_fd_int (int fd, int for_write)
|
translate_sys2libc_fd_int (int fd, int for_write)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
if (fd <= 2)
|
if (fd <= 2)
|
||||||
return fd; /* Do not do this for error, stdin, stdout, stderr. */
|
return fd; /* Do not do this for stdin, stdout, and stderr. */
|
||||||
|
|
||||||
return translate_sys2libc_fd ((void*)fd, for_write);
|
return translate_sys2libc_fd ((void*)(intptr_t)fd, for_write);
|
||||||
#else
|
#else
|
||||||
(void)for_write;
|
(void)for_write;
|
||||||
return fd;
|
return fd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user