@ -787,6 +787,8 @@ popup_editor(struct client *c, const char *buf, size_t len,
if (fd == -1)
return (-1);
f = fdopen(fd, "w");
if (f == NULL)
if (fwrite(buf, len, 1, f) != 1) {
fclose(f);