diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/ChangeLog | 7 | ||||
-rw-r--r-- | util/iobuf.c | 5 | ||||
-rw-r--r-- | util/miscutil.c | 16 |
3 files changed, 19 insertions, 9 deletions
diff --git a/util/ChangeLog b/util/ChangeLog index b1236dea0..3a6ed109e 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,10 @@ +2001-03-29 Werner Koch <[email protected]> + + * miscutil.c (answer_is_yes): An empty string does now return no. + (answer_is_yes_no_quit): Likewise. + + * iobuf.c (iobuf_close): Burn the buffers. + 2001-03-26 Werner Koch <[email protected]> * ttyio.c: Define TERMDEVICE depending on OS. diff --git a/util/iobuf.c b/util/iobuf.c index 471653877..dd1a2b181 100644 --- a/util/iobuf.c +++ b/util/iobuf.c @@ -905,7 +905,10 @@ iobuf_close ( IOBUF a ) a->chain, NULL, &dummy_len)) ) log_error("IOBUFCTRL_FREE failed on close: %s\n", g10_errstr(rc) ); m_free(a->real_fname); - m_free(a->d.buf); + if (a->d.buf) { + memset (a->d.buf, 0, a->d.size); /* erase the buffer */ + m_free(a->d.buf); + } m_free(a); } return rc; diff --git a/util/miscutil.c b/util/miscutil.c index d1af604e6..be41d93d4 100644 --- a/util/miscutil.c +++ b/util/miscutil.c @@ -281,17 +281,17 @@ answer_is_yes( const char *s ) if( !stricmp(s, long_yes ) ) return 1; - if( strchr( short_yes, *s ) && !s[1] ) + if( *s && strchr( short_yes, *s ) && !s[1] ) return 1; /* test for no strings to catch ambiguities for the next test */ if( !stricmp(s, long_no ) ) return 0; - if( strchr( short_no, *s ) && !s[1] ) + if( *s && strchr( short_no, *s ) && !s[1] ) return 0; /* test for the english version (for those who are used to type yes) */ if( !stricmp(s, "yes" ) ) return 1; - if( strchr( "yY", *s ) && !s[1] ) + if( *s && strchr( "yY", *s ) && !s[1] ) return 1; return 0; } @@ -316,19 +316,19 @@ answer_is_yes_no_quit( const char *s ) return 1; if( !stricmp(s, long_quit ) ) return -1; - if( strchr( short_no, *s ) && !s[1] ) + if( *s && strchr( short_no, *s ) && !s[1] ) return 0; - if( strchr( short_yes, *s ) && !s[1] ) + if( *s && strchr( short_yes, *s ) && !s[1] ) return 1; - if( strchr( short_quit, *s ) && !s[1] ) + if( *s && strchr( short_quit, *s ) && !s[1] ) return -1; if( !stricmp(s, "yes" ) ) return 1; if( !stricmp(s, "quit" ) ) return -1; - if( strchr( "yY", *s ) && !s[1] ) + if( *s && strchr( "yY", *s ) && !s[1] ) return 1; - if( strchr( "qQ", *s ) && !s[1] ) + if( *s && strchr( "qQ", *s ) && !s[1] ) return -1; return 0; } |