prevent screenshot from resuing template array
The template array given to mkstemp was declared static. This reused the memory, which caused mkstemp to fail if backingfile is run more than once, because the array no longer contained the template syntax (which is forced to end in XXXXXX) but the previous file name.
This commit is contained in:
parent
69409ea3cb
commit
8ab0073b49
|
@ -122,7 +122,7 @@ static const struct wl_registry_listener registry_listener = {
|
|||
};
|
||||
|
||||
static int backingfile(off_t size) {
|
||||
static char template[] = "/tmp/wlroots-shared-XXXXXX";
|
||||
char template[] = "/tmp/wlroots-shared-XXXXXX";
|
||||
int fd, ret;
|
||||
|
||||
fd = mkstemp(template);
|
||||
|
|
Loading…
Reference in New Issue