If verbose output is specified, print a '.' at every block write.
[zero.git] / util.c
blob8da696e482e9eac62748e5215111d5e9072cc948
1 /* This program is free software. It comes without any warranty, to
2 * the extent permitted by applicable law. You can redistribute it
3 * and/or modify it under the terms of the Do What The Fuck You Want
4 * To Public License, Version 2, as published by Sam Hocevar. See
5 * http://sam.zoy.org/wtfpl/COPYING for more details. */
7 #include <err.h>
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <unistd.h>
12 #include "util.h"
14 void *emalloc(size_t size) {
15 void *buf = calloc(1, size);
17 if(buf == NULL) {
18 err(EXIT_FAILURE, "emalloc");
21 return buf;