~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_tempfile.cc

MergedĀ fromĀ Toru.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
    uint32_t pfx_len;
74
74
    File org_file;
75
75
 
76
 
    pfx_len= (uint) (my_stpcpy(my_stpncpy(prefix_buff,
77
 
                                    prefix ? prefix : "tmp.",
78
 
                                    sizeof(prefix_buff)-7),"XXXXXX") -
79
 
                     prefix_buff);
 
76
    pfx_len= (uint32_t)(strcpy(my_stpncpy(prefix_buff,prefix ? prefix : "tmp.",
 
77
                                          sizeof(prefix_buff)-7),"XXXXXX")+6
 
78
                               -prefix_buff);
80
79
    if (!dir && ! (dir =getenv("TMPDIR")))
81
80
      dir= P_tmpdir;
82
81
    if (strlen(dir)+ pfx_len > FN_REFLEN-2)
84
83
      errno=my_errno= ENAMETOOLONG;
85
84
      return(file);
86
85
    }
87
 
    my_stpcpy(convert_dirname(to,dir,NULL),prefix_buff);
 
86
    strcpy(convert_dirname(to,dir,NULL),prefix_buff);
88
87
    org_file=mkstemp(to);
89
88
    /* TODO: This was old behavior, but really don't we want to 
90
89
     * unlink files immediately under all circumstances?