From 3c61fe86ff793cae3f4161fa7bb741e264dedadc Mon Sep 17 00:00:00 2001 From: Wilhansen Li Date: Mon, 26 Dec 2016 21:55:39 +0800 Subject: [PATCH] Fix input dir edge case bug. --- dtbTool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtbTool.c b/dtbTool.c index db99bc8..eb792e4 100644 --- a/dtbTool.c +++ b/dtbTool.c @@ -123,7 +123,7 @@ int parse_commandline(int argc, char *const argv[]) input_dir = optarg; { int len = strlen(input_dir); - if ( len > 0 && input_dir[len - 2] != '/' ) { + if ( len > 1 && input_dir[len - 2] != '/' ) { input_dir = malloc(len + 2); strcpy(input_dir, optarg); input_dir[len] = '/'; -- 2.20.1