aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo.h
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2010-08-27 14:03:51 -0500
committerPeter Seebach <peter.seebach@windriver.com>2010-08-27 14:14:50 -0500
commitecab857a8a1bd332d6539370c0f183c2b4f004f6 (patch)
tree79af0b464f0fe9ec4d2a7eb26f63efb61277f53c /pseudo.h
parent6f8b09a6df61a547aa58d0748c0d1aba135d9b73 (diff)
downloadpseudo-ecab857a8a1bd332d6539370c0f183c2b4f004f6.tar.gz
pseudo-ecab857a8a1bd332d6539370c0f183c2b4f004f6.tar.bz2
pseudo-ecab857a8a1bd332d6539370c0f183c2b4f004f6.zip
We got bitten AGAIN by hard-coded lengths in memcmp, so we've swapped
that for a macro that does it correctly. Why not just use strcmp, you ask? Because we aren't doing a string compare, we're looking for a prefix.
Diffstat (limited to 'pseudo.h')
-rw-r--r--pseudo.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/pseudo.h b/pseudo.h
index 86fdd72..a568bca 100644
--- a/pseudo.h
+++ b/pseudo.h
@@ -159,6 +159,8 @@ extern char *pseudo_version;
#define PSEUDO_LIBDIR "lib"
#endif
+#define STARTSWITH(x, y) (!memcmp((x), (y), sizeof(y) - 1))
+
#ifndef PSEUDO_LOCALSTATEDIR
#define PSEUDO_LOCALSTATEDIR "var/pseudo"
#endif
@@ -191,3 +193,4 @@ extern char *pseudo_version;
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
#endif
+