From: Simon Josefsson Date: Wed, 7 Jun 2006 13:13:51 +0000 (+0000) Subject: Update. X-Git-Tag: gnutls_1_4_3~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ede4ef442d26f5ca96bfceaffa2a8029b5dddf0;p=thirdparty%2Fgnutls.git Update. --- diff --git a/gl/getpass.c b/gl/getpass.c index 70dc6f5692..6c5bff3457 100644 --- a/gl/getpass.c +++ b/gl/getpass.c @@ -23,7 +23,7 @@ #include -#if !defined _WIN32 +#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) #include @@ -170,13 +170,17 @@ getpass (const char *prompt) return buf; } -#else /* WIN32 */ +#else /* W32 native */ /* Windows implementation by Martin Lambers , improved by Simon Josefsson. */ /* For PASS_MAX. */ #include +/* For _getch(). */ +#include +/* For strdup(). */ +#include #ifndef PASS_MAX # define PASS_MAX 512 diff --git a/gl/m4/stdbool.m4 b/gl/m4/stdbool.m4 index 43fbe28154..2204ecd984 100644 --- a/gl/m4/stdbool.m4 +++ b/gl/m4/stdbool.m4 @@ -64,9 +64,9 @@ AC_DEFUN([AC_HEADER_STDBOOL], char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) -0.5 == true ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; - char f[(_Bool) -0.0 == false ? 1 : -1]; + char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; diff --git a/gl/printf-args.c b/gl/printf-args.c index ba4b8b31fe..67abdc3f81 100644 --- a/gl/printf-args.c +++ b/gl/printf-args.c @@ -1,5 +1,5 @@ /* Decomposed printf argument list. - Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -84,10 +84,29 @@ printf_fetchargs (va_list args, arguments *a) #endif case TYPE_STRING: ap->a.a_string = va_arg (args, const char *); + /* A null pointer is an invalid argument for "%s", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_string == NULL) + ap->a.a_string = "(NULL)"; break; #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: ap->a.a_wide_string = va_arg (args, const wchar_t *); + /* A null pointer is an invalid argument for "%ls", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_wide_string == NULL) + { + static const wchar_t wide_null_string[] = + { + (wchar_t)'(', + (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L', + (wchar_t)')', + (wchar_t)0 + }; + ap->a.a_wide_string = wide_null_string; + } break; #endif case TYPE_POINTER: diff --git a/gl/sha1.c b/gl/sha1.c index 787b95c768..86edf269ee 100644 --- a/gl/sha1.c +++ b/gl/sha1.c @@ -181,7 +181,7 @@ sha1_stream (FILE *stream, void *resblock) return 0; } -/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The +/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ diff --git a/gl/stdint_.h b/gl/stdint_.h index 40be110e35..e6307784cb 100644 --- a/gl/stdint_.h +++ b/gl/stdint_.h @@ -64,7 +64,7 @@ UINTPTR_MAX, PTRDIFF_MIN, PTRDIFF_MAX. */ # define _STDINT_H_HAVE_SYSTEM_INTTYPES #endif -#if !((defined(UNIX_CYGWIN32) || defined(__linux__)) && defined(__BIT_TYPES_DEFINED__)) +#if !((defined(__CYGWIN__) || defined(__linux__)) && defined(__BIT_TYPES_DEFINED__)) # define _STDINT_H_NEED_SIGNED_INT_TYPES #endif