From: Wilhansen Li Date: Fri, 30 Dec 2016 04:25:17 +0000 (+0800) Subject: Fix bug in appending trailing slash on input dir. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aadb0579b4cb87f0acfb561133a8e62ca62f5a81;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_tools_dtbtool.git Fix bug in appending trailing slash on input dir. --- diff --git a/dtbTool.c b/dtbTool.c index 9b28396..680019b 100644 --- a/dtbTool.c +++ b/dtbTool.c @@ -133,7 +133,7 @@ int parse_commandline(int argc, char *const argv[]) input_dir = optarg; { int len = strlen(input_dir); - if ( len > 1 && input_dir[len - 2] != '/' ) { + if ( len > 1 && input_dir[len - 1] != '/' ) { input_dir = malloc(len + 2); strcpy(input_dir, optarg); input_dir[len] = '/';