diff options
author | Leah Neukirchen <leah@vuxu.org> | 2019-04-23 12:34:32 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2019-04-23 12:34:32 +0200 |
commit | 5b0755ca685e2b1079ecd3fc7a2df78d1ac197c9 (patch) | |
tree | bca6f9e545f15b0375020f20d846741cecf52774 | |
parent | fd675ef159748a2d69071a36fcef9a4155be9eeb (diff) | |
download | mblaze-5b0755ca685e2b1079ecd3fc7a2df78d1ac197c9.tar.gz mblaze-5b0755ca685e2b1079ecd3fc7a2df78d1ac197c9.tar.xz mblaze-5b0755ca685e2b1079ecd3fc7a2df78d1ac197c9.zip |
slurp: don't special-case empty files, instead behave like strdup("")
This allows the caller to call free(3) in any case.
-rw-r--r-- | slurp.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/slurp.c b/slurp.c index fff8624..7dbf5ed 100644 --- a/slurp.c +++ b/slurp.c @@ -24,11 +24,6 @@ slurp(char *filename, char **bufo, off_t *leno) r = errno; goto out; } - if (st.st_size == 0) { - *bufo = ""; - *leno = 0; - return 0; - } *bufo = malloc(st.st_size + 1); if (!*bufo) { r = ENOMEM; |