diff options
| author | Michael Brown | 2011-03-29 17:34:07 +0200 |
|---|---|---|
| committer | Michael Brown | 2011-03-30 18:12:10 +0200 |
| commit | 6a6dd5c4524774a6a32cb5c49713ae3250f98da0 (patch) | |
| tree | af7b2cf99aa3ed157d5af18d97c2dba54d92f5c2 /src/hci | |
| parent | [build] Add "allmroms" target (diff) | |
| download | ipxe-6a6dd5c4524774a6a32cb5c49713ae3250f98da0.tar.gz ipxe-6a6dd5c4524774a6a32cb5c49713ae3250f98da0.tar.xz ipxe-6a6dd5c4524774a6a32cb5c49713ae3250f98da0.zip | |
[readline] Add init_editstring() wrapper function
Standardise on using init_editstring() to initialise an embedded
editable string, to match the coding style used by other embedded
objects.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci')
| -rw-r--r-- | src/hci/mucurses/widgets/editbox.c | 3 | ||||
| -rw-r--r-- | src/hci/readline.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/hci/mucurses/widgets/editbox.c b/src/hci/mucurses/widgets/editbox.c index 40e22d629..5d2ba56cc 100644 --- a/src/hci/mucurses/widgets/editbox.c +++ b/src/hci/mucurses/widgets/editbox.c @@ -46,8 +46,7 @@ void init_editbox ( struct edit_box *box, char *buf, size_t len, WINDOW *win, unsigned int row, unsigned int col, unsigned int width, unsigned int flags ) { memset ( box, 0, sizeof ( *box ) ); - box->string.buf = buf; - box->string.len = len; + init_editstring ( &box->string, buf, len ); box->string.cursor = strlen ( buf ); box->win = ( win ? win : stdscr ); box->row = row; diff --git a/src/hci/readline.c b/src/hci/readline.c index e76d2d09a..666ebf0c4 100644 --- a/src/hci/readline.c +++ b/src/hci/readline.c @@ -93,8 +93,7 @@ char * readline ( const char *prompt ) { printf ( "%s", prompt ); memset ( &string, 0, sizeof ( string ) ); - string.buf = buf; - string.len = sizeof ( buf ); + init_editstring ( &string, buf, sizeof ( buf ) ); buf[0] = '\0'; while ( 1 ) { |
