diff src/readpst.c @ 366:67a3ee227495

fix bug in code allowing folders containing multiple item types
author Carl Byington <carl@five-ten-sg.com>
date Mon, 24 Oct 2016 08:43:08 -0700
parents e4c414ff8fa2
children 6b7c19a820e1
line wrap: on
line diff
--- a/src/readpst.c	Tue Aug 30 15:04:12 2016 -0700
+++ b/src/readpst.c	Mon Oct 24 08:43:08 2016 -0700
@@ -2225,12 +2225,11 @@
                     check_filename(temp);
                     while ((f->output[t] = fopen(temp, "r"))) {
                         DEBUG_INFO(("need to increase filename because one already exists with that name\n"));
-                        DEBUG_INFO(("- increasing it to %s%d\n", f->name, x));
                         x++;
-                        sprintf(temp, "%s%08d", f->name, x);
-                        DEBUG_INFO(("- trying \"%s\"\n", f->name));
+                        sprintf(temp, "%s%08d", f->name[t], x);
+                        DEBUG_INFO(("- bump file name and try \"%s\"\n", temp));
                         if (x == 99999999) {
-                            DIE(("create_enter_dir: Why can I not create a folder %s? I have tried %i extensions...\n", f->name, x));
+                            DIE(("create_enter_dir: Why can I not create a folder %s? I have tried %i extensions...\n", f->name[t], x));
                         }
                         fclose(f->output[t]);
                     }