Browse Source

Fix for Windows (MingW) where dirname modifies the passed buffer

tags/v1.1
Bernhard Fröhlich 8 months ago
parent
commit
222eddac8a
Signed by: Bernhard Froehlich <decke@bluelife.at> GPG Key ID: 4DD88C3F9F3B8333
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      drmdecrypt.c

+ 4
- 1
drmdecrypt.c View File

@@ -477,7 +477,10 @@ int main(int argc, char *argv[])
477 477
 
478 478
    /* set and verify outdir */
479 479
    if(strlen(outdir) < 1)
480
-      strcpy(outdir, dirname(argv[optind]));
480
+   {
481
+      strcpy(outdir, argv[optind]);
482
+      strcpy(outdir, dirname(outdir));
483
+   }
481 484
 
482 485
    if(outdir[strlen(outdir)-1] != '/')
483 486
       strcat(outdir, "/");

Loading…
Cancel
Save