diff options
author | Werner Koch <[email protected]> | 2004-02-18 16:59:19 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2004-02-18 16:59:19 +0000 |
commit | 9702e85d5d3c7d1e3ea8ccac7852fa8d1523d4a3 (patch) | |
tree | 5e272a5090fb88fcdef577a1061b951341edf564 /jnlib/stringhelp.c | |
parent | * call-agent.c (start_agent): Ignore an empty GPG_AGENT_INFO. (diff) | |
download | gnupg-9702e85d5d3c7d1e3ea8ccac7852fa8d1523d4a3.tar.gz gnupg-9702e85d5d3c7d1e3ea8ccac7852fa8d1523d4a3.zip |
(print_sanitized_buffer): Don't care about
non-ASCII characaters.
(sanitize_buffer): Ditto.
Diffstat (limited to 'jnlib/stringhelp.c')
-rw-r--r-- | jnlib/stringhelp.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/jnlib/stringhelp.c b/jnlib/stringhelp.c index e2744a5ac..4c8ab314b 100644 --- a/jnlib/stringhelp.c +++ b/jnlib/stringhelp.c @@ -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'; |