Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd-common.h
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2006-11-03 23:01:32 +0100
committerArthur de Jong <arthur@arthurdejong.org>2006-11-03 23:01:32 +0100
commit11c173f2fc6eaf67ff0a186e512de401ea20cf00 (patch)
tree959a46bfb37b839b0f0ef28e0d2918e538d2227e /nslcd-common.h
parent701758762837df1f2d7f6b457690ba1083c24099 (diff)
make SKIP more consistent with READ
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@68 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd-common.h')
-rw-r--r--nslcd-common.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/nslcd-common.h b/nslcd-common.h
index 48ecb64..470809a 100644
--- a/nslcd-common.h
+++ b/nslcd-common.h
@@ -166,12 +166,17 @@
/* set last entry to NULL */ \
(arr)[tmp2int32]=NULL;
+/* skip a number of bytes foreward */
+#define SKIP(fp,sz) \
+ if (fseek(fp,(long)sz,SEEK_CUR)) \
+ { ERROR_OUT_READERROR(fp) }
+
/* read a string from the stream but don't do anything with the result */
#define SKIP_STRING(fp) \
/* read the size of the string */ \
READ_TYPE(fp,tmpint32,int32_t); \
/* seek in the stream past the string contents */ \
- fseek(fp,(long)tmpint32,SEEK_CUR); \
+ SKIP(fp,tmpint32); \
DEBUG_PRINT("SKIP_STRING()\n");
/* skip a loop of strings */