summaryrefslogtreecommitdiff
path: root/ext2fs/balloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext2fs/balloc.c')
-rw-r--r--ext2fs/balloc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext2fs/balloc.c b/ext2fs/balloc.c
index 8cdfb79c..661894f6 100644
--- a/ext2fs/balloc.c
+++ b/ext2fs/balloc.c
@@ -43,6 +43,16 @@
#include <string.h>
#include "ext2fs.h"
+
+/* Returns a pointer to the first occurence of CH in the buffer BUF of len
+ LEN, or BUF + LEN if CH doesn't occur. */
+static inline void *
+memscan (void *buf, unsigned char ch, size_t len)
+{
+ return memchr (buf, ch, len) ?: buf + len;
+}
+
+
#define in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1)
void