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 14:55:37 +0100
committerArthur de Jong <arthur@arthurdejong.org>2006-11-03 14:55:37 +0100
commit245a043d35ef06ccc45f728fa44c1cac7563abcf (patch)
treefa16cd7b93585600c4438548a7f2d72ccec98d9a /nslcd-common.h
parent4dfe010707bb299040170d3dbe3daf0a8cf3268d (diff)
fix bogus reuse of tmpint32, introducing tmp3int32
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@66 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd-common.h')
-rw-r--r--nslcd-common.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/nslcd-common.h b/nslcd-common.h
index f4ce301..48ecb64 100644
--- a/nslcd-common.h
+++ b/nslcd-common.h
@@ -136,8 +136,8 @@
/* read an array from a stram and store the length of the
array in num (size for the array is allocated) */
#define READ_STRINGLIST_NUM(fp,arr,num) \
- READ_TYPE(fp,tmpint32,int32_t); \
- (num)=tmpint32; \
+ /* read the number of entries */ \
+ READ_INT32(fp,(num)); \
/* allocate room for *char[num] */ \
tmpint32*=sizeof(char *); \
BUF_CHECK(fp,tmpint32); \
@@ -151,15 +151,15 @@
/* read an array from a stram and store it as a null-terminated
array list (size for the array is allocated) */
#define READ_STRINGLIST_NULLTERM(fp,arr) \
- READ_TYPE(fp,tmpint32,int32_t); \
+ /* read the number of entries */ \
+ READ_TYPE(fp,tmp3int32,int32_t); \
/* allocate room for *char[num+1] */ \
- tmp2int32=(tmpint32+1)*sizeof(char *); \
+ tmp2int32=(tmp3int32+1)*sizeof(char *); \
BUF_CHECK(fp,tmp2int32); \
(arr)=(char **)BUF_CUR; \
- BUF_SKIP(tmpint32); \
+ BUF_SKIP(tmp2int32); \
/* read all entries */ \
- bufptr+=(size_t)tmpint32; \
- for (tmp2int32=0;tmp2int32<tmpint32;tmp2int32++) \
+ for (tmp2int32=0;tmp2int32<tmp3int32;tmp2int32++) \
{ \
READ_STRING_BUF(fp,(arr)[tmp2int32]); \
} \
@@ -176,9 +176,10 @@
/* skip a loop of strings */
#define SKIP_STRINGLIST(fp) \
- READ_TYPE(fp,tmpint32,int32_t); \
+ /* read the number of entries */ \
+ READ_TYPE(fp,tmp3int32,int32_t); \
/* read all entries */ \
- for (tmp2int32=0;tmp2int32<tmpint32;tmp2int32++) \
+ for (tmp2int32=0;tmp2int32<tmp3int32;tmp2int32++) \
{ \
SKIP_STRING(fp); \
}