diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/ChangeLog | 4 | ||||
-rw-r--r-- | util/miscutil.c | 1 | ||||
-rw-r--r-- | util/secmem.c | 6 | ||||
-rw-r--r-- | util/ttyio.c | 12 |
4 files changed, 20 insertions, 3 deletions
diff --git a/util/ChangeLog b/util/ChangeLog index a52ea0a69..aa9afe6e3 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,7 @@ +Wed Jul 29 14:53:34 1998 Werner Koch (wk@(none)) + + * ttyio.c (tty_get_answer_is_yes): New. + Tue Jul 21 10:35:48 1998 Werner Koch (wk@(none)) * argparse.c: New option flag to distinguish options and commands. diff --git a/util/miscutil.c b/util/miscutil.c index 3bdc68a21..e4c2cf1ae 100644 --- a/util/miscutil.c +++ b/util/miscutil.c @@ -91,3 +91,4 @@ answer_is_yes( const char *s ) return 0; } + diff --git a/util/secmem.c b/util/secmem.c index 4721bcd91..d12621324 100644 --- a/util/secmem.c +++ b/util/secmem.c @@ -204,7 +204,7 @@ secmem_malloc( size_t size ) } /* allocate a new block */ if( (poollen + size <= poolsize) ) { - mb = pool + poollen; + mb = (void*)((char*)pool + poollen); poollen += size; mb->size = size; } @@ -240,7 +240,7 @@ secmem_realloc( void *p, size_t newsize ) return p; /* it is easier not to shrink the memory */ a = secmem_malloc( newsize ); memcpy(a, p, size); - memset(a+size, 0, newsize-size); + memset((char*)a+size, 0, newsize-size); secmem_free(p); return a; } @@ -271,7 +271,7 @@ secmem_free( void *a ) int m_is_secure( const void *p ) { - return p >= pool && p < (pool+poolsize); + return p >= pool && p < ((char*)pool+poolsize); } void diff --git a/util/ttyio.c b/util/ttyio.c index bb795c282..99927d660 100644 --- a/util/ttyio.c +++ b/util/ttyio.c @@ -328,3 +328,15 @@ tty_kill_prompt() last_prompt_len = 0; } + +int +tty_get_answer_is_yes( const char *prompt ) +{ + int yes; + char *p = tty_get( prompt ); + tty_kill_prompt(); + yes = answer_is_yes(p); + m_free(p); + return yes; +} + |