]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Update.
authorSimon Josefsson <simon@josefsson.org>
Wed, 7 Jun 2006 13:13:51 +0000 (13:13 +0000)
committerSimon Josefsson <simon@josefsson.org>
Wed, 7 Jun 2006 13:13:51 +0000 (13:13 +0000)
gl/getpass.c
gl/m4/stdbool.m4
gl/printf-args.c
gl/sha1.c
gl/stdint_.h

index 70dc6f56929004d6ff074f9b62a10c905f32730e..6c5bff34576487c131d141c9b14692402be3e28f 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <stdio.h>
 
-#if !defined _WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
 
 #include <stdbool.h>
 
@@ -170,13 +170,17 @@ getpass (const char *prompt)
   return buf;
 }
 
-#else /* WIN32 */
+#else /* W32 native */
 
 /* Windows implementation by Martin Lambers <marlam@marlam.de>,
    improved by Simon Josefsson. */
 
 /* For PASS_MAX. */
 #include <limits.h>
+/* For _getch(). */
+#include <conio.h>
+/* For strdup(). */
+#include <string.h>
 
 #ifndef PASS_MAX
 # define PASS_MAX 512
index 43fbe281543ab3716adb8c607ac92440e4047533..2204ecd98405be59e1a8ef52d6fbd464f61552f7 100644 (file)
@@ -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];
index ba4b8b31fe744240b9599bc46a1f753ffa85f03d..67abdc3f81649dc926023b87224617b10c12bbaa 100644 (file)
@@ -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:
index 787b95c768860dd8b5caa110a9cd326089b3b626..86edf269eea208c8cb27cc850ae84ede789dcac4 100644 (file)
--- 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.  */
index 40be110e35489639c606eee5501079d35f65e7b6..e6307784cb0e00a15ad6d82414708257eeb741d3 100644 (file)
@@ -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