diff options
author | Michael Brown <mcb30@ipxe.org> | 2013-12-03 16:48:56 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2013-12-05 00:37:02 +0000 |
commit | 22001cb206c1320aee27f679a63d2171d35e99c5 (patch) | |
tree | a972bb914371a68d4925dcc007238dcb836546ba /src/usr/pxemenu.c | |
parent | a2638a8edd28e15d90435a0b1aed9b3215666aa4 (diff) | |
download | ipxe-22001cb206c1320aee27f679a63d2171d35e99c5.zip ipxe-22001cb206c1320aee27f679a63d2171d35e99c5.tar.gz ipxe-22001cb206c1320aee27f679a63d2171d35e99c5.tar.bz2 |
[settings] Explicitly separate the concept of a completed fetched setting
The fetch_setting() family of functions may currently modify the
definition of the specified setting (e.g. to add missing type
information). Clean up this interface by requiring callers to provide
an explicit buffer to contain the completed definition of the fetched
setting, if required.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/usr/pxemenu.c')
-rw-r--r-- | src/usr/pxemenu.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/usr/pxemenu.c b/src/usr/pxemenu.c index d50ee6b..c5cffd3 100644 --- a/src/usr/pxemenu.c +++ b/src/usr/pxemenu.c @@ -101,9 +101,9 @@ static int pxe_menu_parse ( struct pxe_menu **menu ) { /* Fetch raw menu */ memset ( raw_menu, 0, sizeof ( raw_menu ) ); - if ( ( raw_menu_len = fetch_setting ( NULL, &pxe_boot_menu_setting, - raw_menu, - sizeof ( raw_menu ) ) ) < 0 ) { + if ( ( raw_menu_len = fetch_raw_setting ( NULL, &pxe_boot_menu_setting, + raw_menu, + sizeof ( raw_menu ) ) ) < 0 ){ rc = raw_menu_len; DBG ( "Could not retrieve raw PXE boot menu: %s\n", strerror ( rc ) ); @@ -116,8 +116,9 @@ static int pxe_menu_parse ( struct pxe_menu **menu ) { raw_menu_end = ( raw_menu + raw_menu_len ); /* Fetch raw prompt length */ - raw_prompt_len = fetch_setting_len ( NULL, - &pxe_boot_menu_prompt_setting ); + raw_prompt_len = + fetch_raw_setting ( NULL, &pxe_boot_menu_prompt_setting, + NULL, 0 ); if ( raw_prompt_len < 0 ) raw_prompt_len = 0; @@ -168,8 +169,8 @@ static int pxe_menu_parse ( struct pxe_menu **menu ) { if ( raw_prompt_len ) { raw_menu_prompt = ( ( ( void * ) raw_menu_item ) + 1 /* NUL */ ); - fetch_setting ( NULL, &pxe_boot_menu_prompt_setting, - raw_menu_prompt, raw_prompt_len ); + fetch_raw_setting ( NULL, &pxe_boot_menu_prompt_setting, + raw_menu_prompt, raw_prompt_len ); (*menu)->timeout = ( ( raw_menu_prompt->timeout == 0xff ) ? -1 : raw_menu_prompt->timeout ); |