View | Details | Raw Unified | Return to bug 15636
Collapse All | Expand All

(-)chemtool-1.6.11/main.c (-1 / +18 lines)
Lines 2938-2944 Link Here
2938
   or save operations as defined by the current i/o mode and displays error
2938
   or save operations as defined by the current i/o mode and displays error
2939
   message dialog if necessary */
2939
   message dialog if necessary */
2940
{
2940
{
2941
  int error;
2941
  int error, length;
2942
  char errtext[255];
2942
  char errtext[255];
2943
  char oldname[512];
2943
  char oldname[512];
2944
  char *tempstr;
2944
  char *tempstr;
Lines 2950-2955 Link Here
2950
  strcpy (oldname, filename);
2950
  strcpy (oldname, filename);
2951
  strcpy (filename,
2951
  strcpy (filename,
2952
	  gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs)));
2952
	  gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs)));
2953
2954
  while ((length = strlen(filename)) > 507 )
2955
  {
2956
    snprintf (errtext, 255, "Input filename %s contains %d\r characters and this too long.\n", filename, strlen(filename));
2957
    gtk_label_set_text (GTK_LABEL (message), errtext);
2958
    gtk_widget_show (messagew);
2959
    gtk_grab_add (messagew);
2960
    strcpy (filename, oldname);
2961
    snprintf (errtext,255, "Chemtool 1.6.11");
2962
    gtk_window_set_title (GTK_WINDOW (window), errtext);
2963
	
2964
    return;
2965
  }
2966
    
2967
    if (strstr(filename, ".cht") == NULL)    
2968
	strcat(filename, ".cht");
2969
	  
2953
  if (datadir == NULL || (int)strlen (datadir) == 0)
2970
  if (datadir == NULL || (int)strlen (datadir) == 0)
2954
    {
2971
    {
2955
      tempstr = strrchr (filename, '/');
2972
      tempstr = strrchr (filename, '/');

Return to bug 15636