Merge pull request #385 from Googulator/script-generator-uninit

Fix uninitialized variables in script-generator
This commit is contained in:
fosslinux 2024-01-08 10:47:53 +00:00 committed by GitHub
commit 0ffe5b5e71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ void output_config(FILE *out) {
char *get_var(char *name) {
/* Search through existing variables. */
Variable *var;
Variable *last;
Variable *last = NULL;
for (var = variables; var != NULL; var = var->next) {
if (strcmp(name, var->name) == 0) {
return var->val;
@ -373,7 +373,7 @@ int interpret(Directive *directive) {
Directive *interpreter(Directive *directives) {
Directive *directive;
Directive *last;
Directive *last = NULL;
for (directive = directives; directive != NULL; directive = directive->next) {
if (interpret(directive)) {
/* This means this directive needs to be removed from the linked list. */