mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
First set of changes to backport the new card code from 2.0.
For compatibility reasons a few new files had to be added. Also added estream-printf as this is now used in app-openpgp.c and provides a better and generic asprintf implementation than the hack we used for the W32 code in ttyio.c. Card code is not yet finished.
This commit is contained in:
parent
b478389753
commit
3459c6b015
37 changed files with 7385 additions and 1694 deletions
18
util/ttyio.c
18
util/ttyio.c
|
@ -239,13 +239,14 @@ tty_printf( const char *fmt, ... )
|
|||
va_start( arg_ptr, fmt ) ;
|
||||
#ifdef _WIN32
|
||||
{
|
||||
char *buf = NULL;
|
||||
char *buf;
|
||||
int n;
|
||||
DWORD nwritten;
|
||||
|
||||
n = vasprintf(&buf, fmt, arg_ptr);
|
||||
if( !buf )
|
||||
log_bug("vasprintf() failed\n");
|
||||
buf = xtryasprintf(fmt, arg_ptr);
|
||||
if (!buf)
|
||||
log_bug("xtryasprintf() failed\n");
|
||||
n = strlen (buf);
|
||||
|
||||
if (!WriteConsoleA (con.out, buf, n, &nwritten, NULL))
|
||||
log_fatal ("WriteConsole failed: %s", w32_strerror (0));
|
||||
|
@ -286,13 +287,14 @@ tty_fprintf (FILE *fp, const char *fmt, ... )
|
|||
va_start( arg_ptr, fmt ) ;
|
||||
#ifdef _WIN32
|
||||
{
|
||||
char *buf = NULL;
|
||||
char *buf;
|
||||
int n;
|
||||
DWORD nwritten;
|
||||
|
||||
n = vasprintf(&buf, fmt, arg_ptr);
|
||||
if( !buf )
|
||||
log_bug("vasprintf() failed\n");
|
||||
buf = xtryasprintf (fmt, arg_ptr);
|
||||
if (!buf)
|
||||
log_bug ("xtryasprintf() failed\n");
|
||||
n = strlen (buf);
|
||||
|
||||
if (!WriteConsoleA (con.out, buf, n, &nwritten, NULL))
|
||||
log_fatal ("WriteConsole failed: %s", w32_strerror (0));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue