(print_sanitized_buffer): Don't care about

non-ASCII characaters.
(sanitize_buffer): Ditto.
This commit is contained in:
Werner Koch 2004-02-18 16:59:19 +00:00
parent 16f3d8396e
commit 9702e85d5d
2 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2004-02-18 Werner Koch <wk@gnupg.org>
* stringhelp.c (print_sanitized_buffer): Don't care about
non-ASCII characaters.
(sanitize_buffer): Ditto.
2004-02-12 Werner Koch <wk@gnupg.org>
* Makefile.am: Replaced INCLUDES by AM_CPPFLAGS.

View File

@ -327,7 +327,7 @@ print_sanitized_buffer (FILE *fp, const void *buffer, size_t length,
for (; length; length--, p++, count++)
{
if (*p < 0x20 || (*p >= 0x7f && *p < 0xa0) || *p == delim)
if (*p < 0x20 || *p == 0x7f || *p == delim)
{
putc ('\\', fp);
count++;
@ -408,8 +408,7 @@ sanitize_buffer (const unsigned char *p, size_t n, int delim)
/* first count length */
for (save_n = n, save_p = p, buflen=1 ; n; n--, p++ )
{
if ( *p < 0x20 || (*p >= 0x7f && *p < 0xa0) || *p == delim
|| (delim && *p=='\\'))
if ( *p < 0x20 || *p == 0x7f || *p == delim || (delim && *p=='\\'))
{
if ( *p=='\n' || *p=='\r' || *p=='\f'
|| *p=='\v' || *p=='\b' || !*p )
@ -426,8 +425,7 @@ sanitize_buffer (const unsigned char *p, size_t n, int delim)
d = buffer = jnlib_xmalloc( buflen );
for ( ; n; n--, p++ )
{
if (*p < 0x20 || (*p >= 0x7f && *p < 0xa0) || *p == delim
||(delim && *p=='\\')) {
if (*p < 0x20 || *p == 0x7f || *p == delim || (delim && *p=='\\')) {
*d++ = '\\';
if( *p == '\n' )
*d++ = 'n';