X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=config%2Fzconf.l;h=54058e07a375e4796054b6e90f2b58638ca055ff;hb=d3bea25f5238e5abfe6d061c1e6840e354d27bf8;hp=a2b289519df6139ca2f029e50dba256d2f3b57b3;hpb=d1dbdf395b7ee5330b22008ba7c2cc704e157229;p=carl9170fw.git diff --git a/config/zconf.l b/config/zconf.l index a2b2895..54058e0 100644 --- a/config/zconf.l +++ b/config/zconf.l @@ -27,8 +27,8 @@ static char *text; static int text_size, text_asize; struct buffer { - struct buffer *parent; - YY_BUFFER_STATE state; + struct buffer *parent; + YY_BUFFER_STATE state; }; struct buffer *current_buf; @@ -40,7 +40,7 @@ static void zconf_endfile(void); static void new_string(void) { - text = malloc(START_STRSIZE); + text = xmalloc(START_STRSIZE); text_asize = START_STRSIZE; text_size = 0; *text = 0; @@ -62,13 +62,12 @@ static void append_string(const char *str, int size) static void alloc_string(const char *str, int size) { - text = malloc(size + 1); + text = xmalloc(size + 1); memcpy(text, str, size); text[size] = 0; } %} -ws [ \n\t] n [A-Za-z0-9_] %% @@ -288,7 +287,7 @@ void zconf_initscan(const char *name) exit(1); } - current_buf = malloc(sizeof(*current_buf)); + current_buf = xmalloc(sizeof(*current_buf)); memset(current_buf, 0, sizeof(*current_buf)); current_file = file_lookup(name); @@ -299,7 +298,7 @@ void zconf_nextfile(const char *name) { struct file *iter; struct file *file = file_lookup(name); - struct buffer *buf = malloc(sizeof(*buf)); + struct buffer *buf = xmalloc(sizeof(*buf)); memset(buf, 0, sizeof(*buf)); current_buf->state = YY_CURRENT_BUFFER;