A buffer variable wasn't dereferenced in two similar comparisons in ResList
[AROS.git] / compiler / alib / buildeasyrequest.c
blobf4eeb59fb14bf33f25c7404a0f2288c44eed38e3
1 /*
2 Copyright � 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Varargs version of BuildEasyRequestArgs() (intuition.library)
6 Lang: english
7 */
8 #include <stdarg.h>
10 /*****************************************************************************
12 NAME */
13 #define NO_INLINE_STDARG /* turn off inline def */
14 #include <proto/exec.h>
15 #include <proto/intuition.h>
16 #include <intuition/intuition.h>
17 #include <exec/memory.h>
19 struct Window * BuildEasyRequest (
21 /* SYNOPSIS */
22 struct Window * RefWindow,
23 struct EasyStruct * easyStruct,
24 ULONG IDCMP,
25 ...)
27 /* FUNCTION
29 INPUTS
31 RESULT
33 NOTES
35 EXAMPLE
37 BUGS
39 SEE ALSO
40 intuition.library/BuildEasyRequestArgs()
42 INTERNALS
44 *****************************************************************************/
46 va_list args;
47 struct Window * rc;
48 const char *ptr;
49 int argcnt = 0;
50 IPTR *argtable = NULL;
52 for (ptr = easyStruct->es_TextFormat; *ptr; ptr++)
54 if (*ptr == '%')
56 if (ptr[1] == '%')
58 ptr++;
59 continue;
62 argcnt++;
66 for (ptr = easyStruct->es_GadgetFormat; *ptr; ptr++)
68 if (*ptr == '%')
70 if (ptr[1] == '%')
72 ptr++;
73 continue;
76 argcnt++;
80 if (argcnt)
82 va_start (args, IDCMP);
84 int i;
86 argtable = AllocVec(sizeof(IPTR)*argcnt, MEMF_PUBLIC);
88 for (i=0; i < argcnt; i++)
89 argtable[i] = va_arg(args, IPTR);
91 va_end (args);
94 rc = BuildEasyRequestArgs (RefWindow, easyStruct, IDCMP, (APTR)argtable);
96 FreeVec(argtable);
98 return rc;
99 } /* BuildEasyRequest */