~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_tempfile.cc

  • Committer: Eric Herman
  • Date: 2008-12-06 22:37:37 UTC
  • mfrom: (656.1.6 devel)
  • mto: (656.1.8 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: eric@mysql.com-20081206223737-viem01l5uhm0w14r
mergedĀ fromĀ lp:drizzle/mordred

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?