View | Details | Raw Unified
Collapse All | Expand All

(-) ./dos2unix.c.orig (-4 / +8 lines)
 Lines 279-285    Link Here 
  int RetVal = 0;
  int RetVal = 0;
  FILE *InF = NULL;
  FILE *InF = NULL;
  FILE *TempF = NULL;
  FILE *TempF = NULL;
  char TempPath[16];
  char *TempPath = (char *) malloc(sizeof(char) * strlen(ipInFN)+14);
  struct stat StatBuf;
  struct stat StatBuf;
  struct utimbuf UTimeBuf;
  struct utimbuf UTimeBuf;
  int fd;
  int fd;
 Lines 288-294    Link Here 
  if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
  if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
    RetVal = -1;
    RetVal = -1;
  strcpy (TempPath, "./d2utmpXXXXXX");
  strcpy (TempPath, ipInFN);
  strcat (TempPath, "_u2dtmpXXXXXX");
  if((fd=mkstemp (TempPath))<0) {
  if((fd=mkstemp (TempPath))<0) {
	  perror("Failed to open output temp file");
	  perror("Failed to open output temp file");
	  RetVal = -1;
	  RetVal = -1;
 Lines 349-354    Link Here 
      RetVal = -1;
      RetVal = -1;
    }
    }
  }
  }
  free (TempPath);
  return RetVal;
  return RetVal;
}
}
 Lines 364-370    Link Here 
  int RetVal = 0;
  int RetVal = 0;
  FILE *InF = NULL;
  FILE *InF = NULL;
  FILE *TempF = NULL;
  FILE *TempF = NULL;
  char TempPath[16];
  char *TempPath = (char *) malloc(sizeof(char) * strlen(ipInFN)+14);
  struct stat StatBuf;
  struct stat StatBuf;
  struct utimbuf UTimeBuf;
  struct utimbuf UTimeBuf;
  mode_t mode = S_IRUSR | S_IWUSR;
  mode_t mode = S_IRUSR | S_IWUSR;
 Lines 376-382    Link Here 
  else
  else
    mode = StatBuf.st_mode;
    mode = StatBuf.st_mode;
  strcpy (TempPath, "./u2dtmpXXXXXX");
  strcpy (TempPath, ipInFN);
  strcat (TempPath, "_u2dtmpXXXXXX");
  if((fd=mkstemp (TempPath))<0) {
  if((fd=mkstemp (TempPath))<0) {
	  perror("Failed to open output temp file");
	  perror("Failed to open output temp file");
	  RetVal = -1;
	  RetVal = -1;
 Lines 442-447    Link Here 
    }
    }
    RetVal = -1;
    RetVal = -1;
  }
  }
  free (TempPath);
  return RetVal;
  return RetVal;
}
}