summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormor <empty>1994-05-13 10:30:17 +0000
committermor <empty>1994-05-13 10:30:17 +0000
commit1ba9ee6b1b6f3682dd3a66f28c4f727cb0a63360 (patch)
treecbed8529f05bfc66f1c086d4af4add3c1f10965c
parent2435d6bf2033db678669815f40b78dfed517be1d (diff)
Use _XAllocTemp in QueryPhotoflo
-rw-r--r--xc/lib/XIE/photoflo.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/xc/lib/XIE/photoflo.c b/xc/lib/XIE/photoflo.c
index a3c1de1f5..140967245 100644
--- a/xc/lib/XIE/photoflo.c
+++ b/xc/lib/XIE/photoflo.c
@@ -1,4 +1,4 @@
-/* $XConsortium: photoflo.c,v 1.4 94/04/17 20:18:26 rws Exp $ */
+/* $XConsortium: photoflo.c,v 1.5 94/05/06 15:09:49 mor Exp $ */
/*
@@ -248,6 +248,7 @@ unsigned int *navailable_ret;
xieQueryPhotofloReq *req;
xieQueryPhotofloReply rep;
char *pBuf;
+ int i;
LockDisplay (display);
@@ -279,22 +280,40 @@ unsigned int *navailable_ret;
if (rep.expectedCount > 0)
{
+ short *temp = (short *) _XAllocTemp (display,
+ sizeof (short) * rep.expectedCount);
+
*nexpected_ret = rep.expectedCount;
*data_expected_ret = (XiePhototag *) Xmalloc (
sizeof (XiePhototag) * rep.expectedCount);
- _XRead16Pad (display, *data_expected_ret,
+ _XRead16Pad (display, temp,
rep.expectedCount * SIZEOF (xieTypPhototag));
+
+ for (i = 0; i < rep.expectedCount; i++)
+ (*data_expected_ret)[i] = (XiePhototag) temp[i];
+
+ _XFreeTemp (display, (char *) temp,
+ sizeof (short) * rep.expectedCount);
}
if (rep.availableCount > 0)
{
+ short *temp = (short *) _XAllocTemp (display,
+ sizeof (short) * rep.availableCount);
+
*navailable_ret = rep.availableCount;
*data_available_ret = (XiePhototag *) Xmalloc (
sizeof (XiePhototag) * rep.availableCount);
- _XRead16Pad (display, *data_available_ret,
+ _XRead16Pad (display, temp,
rep.availableCount * SIZEOF (xieTypPhototag));
+
+ for (i = 0; i < rep.availableCount; i++)
+ (*data_available_ret)[i] = (XiePhototag) temp[i];
+
+ _XFreeTemp (display, (char *) temp,
+ sizeof (short) * rep.availableCount);
}
UnlockDisplay (display);