mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 16:28:30 +00:00
parent
95f54eeb40
commit
c1d99676c4
1421 changed files with 5556 additions and 2198 deletions
|
@ -33,7 +33,6 @@
|
|||
* - /tmp/
|
||||
*
|
||||
* This guarantees trailing slash.
|
||||
* We also guarantee `kTmpPath` won't be longer than `PATH_MAX / 2`.
|
||||
*/
|
||||
char kTmpPath[PATH_MAX];
|
||||
|
||||
|
@ -47,7 +46,7 @@ __attribute__((__constructor__)) static void kTmpPathInit(void) {
|
|||
uint32_t n;
|
||||
char16_t path16[PATH_MAX];
|
||||
|
||||
if ((s = getenv("TMPDIR")) && (n = strlen(s)) < PATH_MAX / 2) {
|
||||
if ((s = getenv("TMPDIR")) && (n = strlen(s)) < PATH_MAX) {
|
||||
memcpy(kTmpPath, s, n);
|
||||
if (n && kTmpPath[n - 1] != '/') {
|
||||
kTmpPath[n + 0] = '/';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue