summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/fsaf.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/fsaf.h b/lib/fsaf.h
index 516d86a..96f2282 100644
--- a/lib/fsaf.h
+++ b/lib/fsaf.h
@@ -58,17 +58,13 @@ struct fsaf_read_rv {
static inline
struct fsaf_read_rv fsaf_read(FSAF * fp, size_t offset, size_t len)
{
- struct fsaf_read_rv rv;
-
void fsaf_slurp(FSAF * fp, size_t len);
/* Reading nothing - since offset can be bogus in this
* situation, this could foul up our assumptions later, so
* return already here. */
if (len == 0) {
- rv.b = "";
- rv.len = 0;
- return rv;
+ return (struct fsaf_read_rv){ .b = "", .len = 0 };
}
/* Make sure we don't read past the EOF mark. */
@@ -85,9 +81,10 @@ struct fsaf_read_rv fsaf_read(FSAF * fp, size_t offset, size_t len)
assert(offset - fp->buf_offset + len <= fp->buf_size);
assert(offset + len <= fp->eof_mark);
- rv.b = fp->buf + (offset - fp->buf_offset);
- rv.len = len;
- return rv;
+ return (struct fsaf_read_rv){
+ .b = fp->buf + (offset - fp->buf_offset),
+ .len = len
+ };
}
/* Behaves like fsaf_read except that the result is put in a malloc'd