diff options
author | Simon Josefsson <simon@josefsson.org> | 2006-06-07 13:13:51 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2006-06-07 13:13:51 +0000 |
commit | 9ede4ef442d26f5ca96bfceaffa2a8029b5dddf0 (patch) | |
tree | 6bd470cd1efe654a6513fd117e572af77ba276cf /gl | |
parent | 73a39267eefd2d3cdd2b2ee623d937471e52b0aa (diff) | |
download | gnutls-9ede4ef442d26f5ca96bfceaffa2a8029b5dddf0.tar.gz |
Update.
Diffstat (limited to 'gl')
-rw-r--r-- | gl/getpass.c | 8 | ||||
-rw-r--r-- | gl/m4/stdbool.m4 | 4 | ||||
-rw-r--r-- | gl/printf-args.c | 21 | ||||
-rw-r--r-- | gl/sha1.c | 2 | ||||
-rw-r--r-- | gl/stdint_.h | 2 |
5 files changed, 30 insertions, 7 deletions
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 <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 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: @@ -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 |