--- ./dos2unix.c.orig 2007-04-17 11:16:32.000000000 +0400 +++ ./dos2unix.c 2007-04-17 12:41:01.000000000 +0400 @@ -279,7 +279,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; @@ -288,7 +288,8 @@ if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) RetVal = -1; - strcpy (TempPath, "./d2utmpXXXXXX"); + strcpy (TempPath, ipInFN); + strcat (TempPath, "_u2dtmpXXXXXX"); if((fd=mkstemp (TempPath))<0) { perror("Failed to open output temp file"); RetVal = -1; @@ -349,6 +350,7 @@ RetVal = -1; } } + free (TempPath); return RetVal; } @@ -364,7 +366,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; mode_t mode = S_IRUSR | S_IWUSR; @@ -376,7 +378,8 @@ else mode = StatBuf.st_mode; - strcpy (TempPath, "./u2dtmpXXXXXX"); + strcpy (TempPath, ipInFN); + strcat (TempPath, "_u2dtmpXXXXXX"); if((fd=mkstemp (TempPath))<0) { perror("Failed to open output temp file"); RetVal = -1; @@ -442,6 +445,7 @@ } RetVal = -1; } + free (TempPath); return RetVal; }