twice, and abort with an error if this is the case.
(Address IBM Bugzilla bug #1226)
+2002-12-18 Theodore Ts'o <tytso@mit.edu>
+
+ * pass2.c (strnlen): Provide strnlen if libc doesn't.
+
2003-11-19 Theodore Ts'o <tytso@mit.edu>
* unix.c (PRS): Print an error if more than one of the -p/-a, -n
e2fsck_t ctx;
};
+#ifndef HAVE_STRNLEN
+/*
+ * Incredibly, libc5 doesn't appear to have strnlen. So we have to
+ * provide our own.
+ */
+static int strnlen(const char * s, int count)
+{
+ const char *cp = s;
+
+ while (count-- && *cp)
+ cp++;
+ return cp - s;
+}
+#endif
+
void e2fsck_pass2(e2fsck_t ctx)
{
struct ext2_super_block *sb = ctx->fs->super;