diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/cbfstool/common.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/util/cbfstool/common.h b/util/cbfstool/common.h index 561a17abe3..42ae1e2b3d 100644 --- a/util/cbfstool/common.h +++ b/util/cbfstool/common.h @@ -62,6 +62,11 @@ static inline size_t buffer_size(const struct buffer *b) return b->size; } +static inline size_t buffer_offset(const struct buffer *b) +{ + return b->offset; +} + /* * Shrink a buffer toward the beginning of its previous space. * Afterward, buffer_delete() remains the means of cleaning it up. */ @@ -125,7 +130,7 @@ static inline void *buffer_get_original_backing(const struct buffer *b) { if (!b) return NULL; - return b->data - b->offset; + return buffer_get(b) - buffer_offset(b); } /* Creates an empty memory buffer with given size. |