summaryrefslogtreecommitdiffstats
path: root/src/hci
diff options
context:
space:
mode:
authorMichael Brown2007-01-05 15:48:20 +0100
committerMichael Brown2007-01-05 15:48:20 +0100
commitd0a3cc3417c0de4599ef3289b5e50cdc62bc7b89 (patch)
tree12ad41ac6d1676172e220a00e9ed7c83c9506d69 /src/hci
parentPartial implementation of UNDI loader caller. (diff)
downloadipxe-d0a3cc3417c0de4599ef3289b5e50cdc62bc7b89.tar.gz
ipxe-d0a3cc3417c0de4599ef3289b5e50cdc62bc7b89.tar.xz
ipxe-d0a3cc3417c0de4599ef3289b5e50cdc62bc7b89.zip
Avoid creating implicit memcpy()s
Diffstat (limited to 'src/hci')
-rw-r--r--src/hci/mucurses/print.c7
-rw-r--r--src/hci/readline.c10
2 files changed, 8 insertions, 9 deletions
diff --git a/src/hci/mucurses/print.c b/src/hci/mucurses/print.c
index dd9e299c..fc14e67e 100644
--- a/src/hci/mucurses/print.c
+++ b/src/hci/mucurses/print.c
@@ -56,11 +56,10 @@ static void _printw_handler ( struct printf_context *ctx, unsigned int c ) {
* @ret rc return status code
*/
int vw_printw ( WINDOW *win, const char *fmt, va_list varglist ) {
- struct printw_context wctx = {
- .win = win,
- .ctx = { .handler = _printw_handler, },
- };
+ struct printw_context wctx;
+ wctx.win = win;
+ wctx.ctx.handler = _printw_handler;
vcprintf ( &(wctx.ctx), fmt, varglist );
return OK;
}
diff --git a/src/hci/readline.c b/src/hci/readline.c
index 4fac0986..420df648 100644
--- a/src/hci/readline.c
+++ b/src/hci/readline.c
@@ -80,18 +80,18 @@ static void sync_console ( struct edit_string *string ) {
*/
char * readline ( const char *prompt ) {
char buf[READLINE_MAX];
- struct edit_string string = {
- .buf = buf,
- .len = sizeof ( buf ),
- .cursor = 0,
- };
+ struct edit_string string;
int key;
char *line;
if ( prompt )
printf ( "%s", prompt );
+ memset ( &string, 0, sizeof ( string ) );
+ string.buf = buf;
+ string.len = sizeof ( buf );
buf[0] = '\0';
+
while ( 1 ) {
key = edit_string ( &string, getkey() );
sync_console ( &string );