git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
feat: block partition support
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
buffer.h
diff --git
a/lunaix-os/includes/lunaix/buffer.h
b/lunaix-os/includes/lunaix/buffer.h
index 605cf8b47602e62fdcbe35bf1d864be022e7a15c..851d56844f3fd6854904c5e36da197f0818c453b 100644
(file)
--- a/
lunaix-os/includes/lunaix/buffer.h
+++ b/
lunaix-os/includes/lunaix/buffer.h
@@
-40,6
+40,10
@@
vbuf_alloc(struct vecbuf* vec, void* buf, size_t len);
static inline size_t
vbuf_size(struct vecbuf* vbuf)
{
+ if (!vbuf) {
+ return 0;
+ }
+
struct vecbuf* last =
list_entry(vbuf->components.prev, struct vecbuf, components);
return last->acc_sz;