1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-09-24 15:31:41 +02:00

Fix a W32 problem

This commit is contained in:
Werner Koch 2009-09-03 15:27:30 +00:00
parent 91272a546f
commit 7956620485
8 changed files with 31 additions and 8 deletions

View File

@ -1,3 +1,7 @@
2009-09-03 Werner Koch <wk@g10code.com>
* util.h (xtryvasprintf): New.
2009-08-25 Werner Koch <wk@g10code.com>
* compat.h: Add xstrconcat.

View File

@ -20,9 +20,7 @@
#ifndef G10_UTIL_H
#define G10_UTIL_H
#if defined (_WIN32) || defined (__CYGWIN32__)
#include <stdarg.h>
#endif
#include "types.h"
#include "errors.h"
@ -245,6 +243,7 @@ int write_w32_registry_string(const char *root, const char *dir,
/*-- strgutil.c --*/
char *xasprintf (const char *fmt, ...);
char *xtryasprintf (const char *fmt, ...);
char *xtryvasprintf (const char *fmt, va_list arg_ptr);
/*-- pka.c --*/

View File

@ -1,3 +1,7 @@
2009-09-03 Werner Koch <wk@g10code.com>
* w32installer.nsi: Set the final OutPath to Doc/.
2008-01-30 Werner Koch <wk@g10code.com>
* w32installer.nsi: Set the OutPath back.

View File

@ -352,7 +352,7 @@ Section "-Finish"
;;
# Set the Outpath pack so that the README file can be displayed.
SetOutPath "$INSTDIR"
SetOutPath "$INSTDIR\Doc"
SectionEnd ; "-Finish"

View File

@ -1,5 +1,8 @@
2009-09-03 Werner Koch <wk@g10code.com>
* ttyio.c (tty_printf) [_WIN32]: s/xtryasprintf/xtryvasprint/
* strgutil.c (xtryvasprintf): New.
* estream-printf.c: Include stdint.h only if HAVE_STDINT_H is
defined. Problem reported by Nelson H. F. Beebe.
* estream.m4: Check for stdint.h.

View File

@ -917,7 +917,7 @@ default_strusage( int level )
break;
case 11: p = "foo"; break;
case 13: p = "0.0"; break;
case 14: p = "Copyright (C) 2008 Free Software Foundation, Inc."; break;
case 14: p = "Copyright (C) 2009 Free Software Foundation, Inc."; break;
case 15: p =
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law.\n";

View File

@ -1153,6 +1153,19 @@ xtryasprintf (const char *fmt, ...)
}
char *
xtryvasprintf (const char *fmt, va_list arg_ptr)
{
int rc;
char *buf;
rc = estream_vasprintf (&buf, fmt, arg_ptr);
if (rc < 0)
return NULL;
return buf;
}
/****************************************************
******** locale insensitive ctype functions ********
****************************************************/

View File

@ -243,9 +243,9 @@ tty_printf( const char *fmt, ... )
int n;
DWORD nwritten;
buf = xtryasprintf(fmt, arg_ptr);
buf = xtryvasprintf(fmt, arg_ptr);
if (!buf)
log_bug("xtryasprintf() failed\n");
log_bug("xtryvasprintf() failed\n");
n = strlen (buf);
if (!WriteConsoleA (con.out, buf, n, &nwritten, NULL))
@ -291,9 +291,9 @@ tty_fprintf (FILE *fp, const char *fmt, ... )
int n;
DWORD nwritten;
buf = xtryasprintf (fmt, arg_ptr);
buf = xtryvasprintf (fmt, arg_ptr);
if (!buf)
log_bug ("xtryasprintf() failed\n");
log_bug ("xtryvasprintf() failed\n");
n = strlen (buf);
if (!WriteConsoleA (con.out, buf, n, &nwritten, NULL))