A buffer variable wasn't dereferenced in two similar comparisons in ResList
[AROS.git] / compiler / alib / easyrequest.c
bloba4d4720e42b75a683294a31a0eed5debb29f9dd7
1 /*
2 Copyright � 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <stdarg.h>
8 /*****************************************************************************
10 NAME */
11 #define NO_INLINE_STDARG /* turn off inline def */
12 #include <proto/intuition.h>
13 #include <intuition/intuition.h>
14 #include <proto/exec.h>
15 #include <exec/memory.h>
16 LONG EasyRequest (
18 /* SYNOPSIS */
19 struct Window * window,
20 struct EasyStruct * easyStruct,
21 ULONG * idcmpPtr,
22 ...)
24 /* FUNCTION
26 INPUTS
28 RESULT
30 NOTES
32 EXAMPLE
34 BUGS
36 SEE ALSO
38 INTERNALS
40 *****************************************************************************/
42 va_list args;
43 LONG rc;
44 const char *ptr;
45 int argcnt = 0;
46 IPTR *argtable = NULL;
48 for (ptr = easyStruct->es_TextFormat; *ptr; ptr++)
50 if (*ptr == '%')
52 if (ptr[1] == '%')
54 ptr++;
55 continue;
58 argcnt++;
62 for (ptr = easyStruct->es_GadgetFormat; *ptr; ptr++)
64 if (*ptr == '%')
66 if (ptr[1] == '%')
68 ptr++;
69 continue;
72 argcnt++;
76 if (argcnt)
78 va_start (args, idcmpPtr);
80 int i;
82 argtable = AllocVec(sizeof(IPTR)*argcnt, MEMF_PUBLIC);
84 for (i=0; i < argcnt; i++)
85 argtable[i] = va_arg(args, IPTR);
87 va_end (args);
90 rc = EasyRequestArgs (window, easyStruct, idcmpPtr, (APTR)argtable);
92 FreeVec(argtable);
94 return rc;
95 } /* EasyRequest */