Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/xinstall/xinstall.c
Show First 20 Lines • Show All 1,155 Lines • ▼ Show 20 Lines | create_tempfile(const char *path, char *temp, size_t tsize) | ||||
char *p; | char *p; | ||||
(void)strncpy(temp, path, tsize); | (void)strncpy(temp, path, tsize); | ||||
temp[tsize - 1] = '\0'; | temp[tsize - 1] = '\0'; | ||||
if ((p = strrchr(temp, '/')) != NULL) | if ((p = strrchr(temp, '/')) != NULL) | ||||
p++; | p++; | ||||
else | else | ||||
p = temp; | p = temp; | ||||
(void)strncpy(p, "INS@XXXX", &temp[tsize - 1] - p); | (void)strncpy(p, "INS@XXXXXX", &temp[tsize - 1] - p); | ||||
temp[tsize - 1] = '\0'; | temp[tsize - 1] = '\0'; | ||||
return (mkstemp(temp)); | return (mkstemp(temp)); | ||||
} | } | ||||
/* | /* | ||||
* create_newfile -- | * create_newfile -- | ||||
* create a new file, overwriting an existing one if necessary | * create a new file, overwriting an existing one if necessary | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 370 Lines • Show Last 20 Lines |