commit 7f47e8fa20052b0965afba874a5eea6e4299744a
parent 4d8d31613334b41b6fbf9f3f65d1dc416e47b433
Author: sin <sin@2f30.org>
Date: Wed, 6 Mar 2013 01:09:33 +0000
memzap: Stylistic changes
Diffstat:
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/memzap.c b/memzap.c
@@ -29,15 +29,14 @@ dump_base_image(const char *name, void *buf, size_t len)
snprintf(mem_path, sizeof(mem_path),
"%s.mem", name);
- fdmem = open(mem_path,
- O_CREAT | O_RDWR | O_TRUNC,
- 0644);
+ fdmem = open(mem_path, O_CREAT | O_RDWR | O_TRUNC, 0644);
if (fdmem < 0)
- errx(1, "%s: %s", mem_path,
- strerror(errno));
+ errx(1, "%s: %s", mem_path, strerror(errno));
+
ret = write(fdmem, buf, len);
if ((size_t)ret != len)
err(1, "write");
+
close(fdmem);
}