# # old_revision [63361f1c30b0d8e84bbe32b758414e36fdb786e6] # # patch "mkstemp.cc" # from [450d3f028d322b58cde8e1369ebe78061faecc20] # to [e4bc406d8843b959ece7978ea83fb29889157646] # ============================================================ --- mkstemp.cc 450d3f028d322b58cde8e1369ebe78061faecc20 +++ mkstemp.cc e4bc406d8843b959ece7978ea83fb29889157646 @@ -138,8 +138,8 @@ monotone_mkstemp(string & tmpl) if (xes == string::npos) return false; - char buf[len+1]; - memcpy(buf, tmpl.data(), len); + std::vector buf(len + 1); + memcpy(&buf[0], tmpl.data(), len); buf[len] = 0; seed_lfsr113(); @@ -155,11 +155,11 @@ monotone_mkstemp(string & tmpl) x /= NLETTERS; } - int fd = open(buf, O_RDWR|O_CREAT|O_EXCL|O_BINARY, 0600); + int fd = open(&buf[0], O_RDWR|O_CREAT|O_EXCL|O_BINARY, 0600); if (fd >= 0) { close(fd); - tmpl.replace(xes, 6, buf+xes, 6); + tmpl.replace(xes, 6, &buf[xes], 6); return true; } else if (errno != EEXIST)