diff --git a/src/filegen.c b/src/filegen.c index 8b01cc67..6f95dd33 100644 --- a/src/filegen.c +++ b/src/filegen.c @@ -382,7 +382,10 @@ void file_rename(const char *old_filename, const unsigned char *buffer, const in /* Add original filename */ if(offset < buffer_size && buffer!=NULL) { + char *dst_old=dst; int off; + int ok=0; + int bad=0; *dst++ = '_'; for(off=offset; off dst_old && *(dst-1)=='_') + dst--; + } } /* Add extension */ if(new_ext!=NULL) @@ -458,7 +475,10 @@ void file_rename_unicode(const char *old_filename, const unsigned char *buffer, /* Add original filename */ if(offset < buffer_size && buffer!=NULL) { + char *dst_old=dst; int off; + int ok=0; + int bad=0; *dst++ = '_'; for(off=offset; off dst_old && *(dst-1)=='_') + dst--; + } } /* Add extension */ if(new_ext!=NULL)