mirror of
https://github.com/xcat2/xNBA.git
synced 2025-08-23 11:40:27 +00:00
[image] Allow image_set_cmdline() to clear the command line
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -95,14 +95,18 @@ void image_set_uri ( struct image *image, struct uri *uri ) {
|
||||
* Set image command line
|
||||
*
|
||||
* @v image Image
|
||||
* @v cmdline New image command line
|
||||
* @v cmdline New image command line, or NULL
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
int image_set_cmdline ( struct image *image, const char *cmdline ) {
|
||||
|
||||
free ( image->cmdline );
|
||||
image->cmdline = strdup ( cmdline );
|
||||
if ( ! image->cmdline )
|
||||
return -ENOMEM;
|
||||
image->cmdline = NULL;
|
||||
if ( cmdline ) {
|
||||
image->cmdline = strdup ( cmdline );
|
||||
if ( ! image->cmdline )
|
||||
return -ENOMEM;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user