Fix bug in appending trailing slash on input dir.
authorWilhansen Li <wil@byimplication.com>
Fri, 30 Dec 2016 04:25:17 +0000 (12:25 +0800)
committerWilhansen Li <wil@byimplication.com>
Fri, 30 Dec 2016 04:25:17 +0000 (12:25 +0800)
dtbTool.c

index 9b283968c3c2f7078eab4fc4264874ca0334c9ce..680019b244593d9f8d6cd3db3b5da759fb9f839e 100644 (file)
--- 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] = '/';