mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Cherry-pick bug fixes and Landlock Make 1.0.2
This commit is contained in:
parent
c1d99676c4
commit
7e1c78b4f3
13 changed files with 468 additions and 64 deletions
|
@ -38,10 +38,11 @@
|
|||
* @raise EINVAL if template didn't end with XXXXXX
|
||||
*/
|
||||
char *mkdtemp(char *template) {
|
||||
int i, j, n, x;
|
||||
unsigned x;
|
||||
int i, j, n;
|
||||
if ((n = strlen(template)) >= 6 && !memcmp(template + n - 6, "XXXXXX", 6)) {
|
||||
x = rand64();
|
||||
for (i = 0; i < 10; ++i) {
|
||||
x = rand64();
|
||||
for (j = 0; j < 6; ++j) {
|
||||
template[n - 6 + j] = "0123456789abcdefghijklmnopqrstuvwxyz"[x % 36];
|
||||
x /= 36;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue