diff --git a/eval.c b/eval.c index 671c7aa..45e7937 100644 --- a/eval.c +++ b/eval.c @@ -1428,16 +1428,23 @@ int clrmes( int f, int n) { * int f, n; arguments ignored */ int writemsg( int f, int n) { - int status; - char buf[ NSTRING] ; /* buffer to recieve message into */ + int status ; + int size ; + char *buf ; /* buffer to receive message into */ - status = mlreply( "Message to write: ", buf, sizeof buf - 1) ; - if( status != TRUE) - return status ; + size = term.t_ncol + 1 ; + buf = malloc( size) ; + if( buf == NULL) + return FALSE ; + status = mlreply( "Message to write: ", buf, size) ; + if( status == TRUE) /* write the message out */ - mlforce( buf) ; - return TRUE ; + mlforce( buf) ; + + free( buf) ; + return status ; } +/* end of eval.c */