From: Lukas Krickl Date: Mon, 23 Mar 2026 04:56:35 +0000 (+0100) Subject: preproc: Fixed bug that would cause preproc current depth to be X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=0f6b43bb9c53d615d1844411ea5e507463125b22;p=ulas%2F.git preproc: Fixed bug that would cause preproc current depth to be uninitialized. This would randomly cause preproc to fail. --- diff --git a/src/ulas.c b/src/ulas.c index bbb51df..93fdf70 100644 --- a/src/ulas.c +++ b/src/ulas.c @@ -979,7 +979,7 @@ void ulas_trimend(char c, char *buf, unsigned long n) { char *ulas_preprocexpand2(struct ulas_preproc *pp, const char *raw_line, unsigned long *n, int recursive); void ulas_preprocexpand_rec(struct ulas_preproc *pp) { - unsigned long n; + unsigned long n = 0; /* expand macro result again to allow * defines to appear in the macro */ @@ -1539,6 +1539,7 @@ int ulas_preprocnext(struct ulas_preproc *pp, FILE *dst, FILE *src, char *buf, struct ulas_preproc ulas_preprocinit(void) { int i; struct ulas_preproc pp; + memset(&pp, 0, sizeof(pp)); pp.defs = NULL; pp.defslen = 0; pp.tok = ulas_str(1);