From db30d6d734f17d39851cea3a2cc55f931370a75c Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Thu, 1 Oct 2015 08:19:39 +0800 Subject: [PATCH] Mode commands based on newmlarg (replacement of mlreply). --- random.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/random.c b/random.c index edd480e..bb667a7 100644 --- a/random.c +++ b/random.c @@ -944,7 +944,7 @@ static int adjustmode( int kind, int global) { unsigned i ; /* loop index */ int status; /* error return on input */ char prompt[50]; /* string to prompt user with */ - char cbuf[ NSTRING] ; /* buffer to recieve mode name into */ + char *cbuf ; /* buffer to recieve mode name into */ /* build the proper prompt string */ if (global) @@ -959,7 +959,7 @@ static int adjustmode( int kind, int global) { /* prompt the user and get an answer */ - status = mlreply( prompt, cbuf, sizeof cbuf - 1) ; + status = newmlarg( &cbuf, prompt, 0) ; if (status != TRUE) return status; @@ -987,6 +987,7 @@ static int adjustmode( int kind, int global) { curwp->w_flag |= WFCOLR; #endif mlerase(); + free( cbuf) ; return TRUE; } } @@ -1009,11 +1010,13 @@ static int adjustmode( int kind, int global) { if (global == 0) upmode(); mlerase(); /* erase the junk */ + free( cbuf) ; return TRUE; } } mlwrite("No such mode!"); + free( cbuf) ; return FALSE; }