don't run out of memory.
* amd/sun_map_parse.y: declare extern for sun_map_parse().
* libamu/xutil.c (xsnprintf): ensure proper comparisons between
signed and unsigned quantities.
+2005-08-08 Erez Zadok <ezk@cs.sunysb.edu>
+
+ * amd/sun_map_tok.l: allocate more output slots so lex scanners
+ don't run out of memory.
+
+ * amd/sun_map_parse.y: declare extern for sun_map_parse().
+
+ * libamu/xutil.c (xsnprintf): ensure proper comparisons between
+ signed and unsigned quantities.
+
2005-08-06 Erez Zadok <ezk@cs.sunysb.edu>
* libamu/util.c, amd/autil.c (strsplit): moved strsplit() function
#include <amd.h>
#include <sun_map.h>
-extern int sun_map_lex();
+extern int sun_map_lex(void);
extern int sun_map_error(const char* s);
extern void sun_map_tok_setbuff(const char *);
+extern int sun_map_parse(void);
struct sun_entry *sun_map_parse_read(const char *map_data);
static struct sun_list *sun_host_list = NULL;
static struct sun_list *sun_location_list = NULL;
static struct sun_list *mountpt_list = NULL;
-static char* tmpFsType = NULL;
+static char *tmpFsType = NULL;
/*
*/
%option nounput
+/* allocate more output slots so lex scanners don't run out of mem */
+%o 1024
+
%%
{WORD_REX} {
* possible infinite recursion between plog() and xsnprintf(). If it ever
* happens, it'd indicate a bug in Amd.
*/
- if (ret < 0 || ret >= size) { /* error or truncation occured */
+ if (ret < 0 || (size_t) ret >= size) { /* error or truncation occured */
static int maxtrunc; /* hack to avoid inifinite loop */
if (++maxtrunc > 10)
plog(XLOG_ERROR, "BUG: string %p truncated (ret=%d, format=\"%s\")",