rem: semiglobalfile = fopen(filename, "w");
add: semiglobalfile = fopen(filename, "wb");
context: static gboolean download_last_movie_store_filename(GtkWidget *widget) {  //  GtkFileSelection *file_selection_box = data;  //  semiglobalfile = NULL;  FILE* semiglobalfile = NULL;  GtkWidget *file_selection_box = widget;  constant_string c_s;  //char filename[STRINGSIZE];   char tempfilename[STRINGSIZE];  const gchar* filename;  GError* error = NULL;  //Log("before");  filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(file_selection_box));  Log("Filename: ");  //  Log(filename);  //Log("after");  semiglobalfile = fopen(filename, "w");  if (semiglobalfile == NULL) {    //reuse c_s    strncpy(tempfilename, filename, STRINGSIZE - 3);    strcat(tempfilename, "/.");        c_s = GetMovieName(tempfilename);        semiglobalfile = fopen(c_s.text, "w");      if (semiglobalfile == NULL) {      strcpy(c_s.text,"Trouble opening ");      if (strlen(c_s.text) + strlen(filename) < STRINGSIZE) {	strcat(c_s.text, filename);      }      Log(c_s.text);      //using_dialog_mutex = FALSE;      //      EnableControls(TRUE);      return FALSE;    }  }  //  using_dialog_mutex = FALSE;  //  idle_tag = gtk_idle_add(GTK_SIGNAL_FUNC(download_last_movie_start), semiglobalfile);  if (!g_thread_create(download_last_movie_start, semiglobalfile, FALSE, &error)) {    Log(error->message);    return FALSE;  }  return TRUE;}