summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 55467ca..5a1cc35 100644
--- a/src/main.c
+++ b/src/main.c
@@ -182,8 +182,10 @@ static void parse_image_arg(char * arg, struct image_list ** image_first) {
*(parts++) = 0;
layout_file = parts;
- while ( ( ptr = strchr(layout_file, '%') ) )
- layout_file = ptr+1;
+ if ( layout_file ) {
+ while ( ( ptr = strchr(layout_file, '%') ) )
+ layout_file = ptr+1;
+ }
type = NULL;
device = NULL;