--- ./unix2dos.c.orig 2007-09-29 11:13:16.000000000 +0400 +++ ./unix2dos.c 2007-09-29 11:15:22.000000000 +0400 @@ -204,7 +204,7 @@ int RetVal = 0; FILE *InF = NULL; FILE *TempF = NULL; - char TempPath[16]; + char *TempPath = (char *) malloc(sizeof(char) * strlen(ipInFN)+14); struct stat StatBuf; struct utimbuf UTimeBuf; int fd; @@ -213,7 +213,8 @@ if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) RetVal = -1; - strcpy (TempPath, "./u2dtmpXXXXXX"); + strcpy (TempPath, ipInFN); + strcat (TempPath, "_u2dtmpXXXXXX"); if((fd=mkstemp (TempPath)) < 0) { perror("Can't open output temp file"); RetVal = -1; @@ -276,6 +277,7 @@ } } + free (TempPath); return RetVal; } @@ -289,7 +291,7 @@ int RetVal = 0; FILE *InF = NULL; FILE *TempF = NULL; - char TempPath[16]; + char *TempPath = (char *) malloc(sizeof(char) * strlen(ipInFN)+14); struct stat StatBuf; struct utimbuf UTimeBuf; int fd; @@ -298,7 +300,8 @@ if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) RetVal = -1; - strcpy (TempPath, "./u2dtmpXXXXXX"); + strcpy (TempPath, ipInFN); + strcat (TempPath, "_u2dtmpXXXXXX"); if((fd=mkstemp (TempPath)) < 0) { perror("Can't open output temp file"); RetVal = -1; @@ -361,6 +364,8 @@ } RetVal = -1; } + + free (TempPath); return RetVal; }