diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-10 15:13:15 -0400 | 
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-10 15:13:15 -0400 | 
| commit | 4250d9bcfcf9dbc95418c64932ad39f71ff2019e (patch) | |
| tree | a50b979c8817af4017e595928da6dc4524b37d40 /src/ini.c | |
| parent | ed3f041df1d891b188fabfc055547c076ce6e85e (diff) | |
| download | stasis-4250d9bcfcf9dbc95418c64932ad39f71ff2019e.tar.gz | |
Use do/while in guard_* macros to make them behave more like functions
Diffstat (limited to 'src/ini.c')
| -rw-r--r-- | src/ini.c | 22 | 
1 files changed, 11 insertions, 11 deletions
| @@ -225,17 +225,17 @@ void ini_free(struct INIFILE **ini) {      for (size_t section = 0; section < (*ini)->section_count; section++) {          for (size_t data = 0; data < (*ini)->section[section]->data_count; data++) {              if ((*ini)->section[section]->data[data]) { -                guard_free((*ini)->section[section]->data[data]->key) -                guard_free((*ini)->section[section]->data[data]->value) -                guard_free((*ini)->section[section]->data[data]) +                guard_free((*ini)->section[section]->data[data]->key); +                guard_free((*ini)->section[section]->data[data]->value); +                guard_free((*ini)->section[section]->data[data]);              }          } -        guard_free((*ini)->section[section]->data) -        guard_free((*ini)->section[section]->key) -        guard_free((*ini)->section[section]) +        guard_free((*ini)->section[section]->data); +        guard_free((*ini)->section[section]->key); +        guard_free((*ini)->section[section]);      } -    guard_free((*ini)->section) -    guard_free((*ini)) +    guard_free((*ini)->section); +    guard_free((*ini));  }  struct INIFILE *ini_open(const char *filename) { @@ -302,7 +302,7 @@ struct INIFILE *ini_open(const char *filename) {              // Ignore default section because we already have an implicit one              if (!strncmp(section_name, "default", strlen("default"))) { -                guard_free(section_name) +                guard_free(section_name);                  continue;              } @@ -312,7 +312,7 @@ struct INIFILE *ini_open(const char *filename) {              // Record the name of the section. This is used until another section is found.              strcpy(current_section, section_name); -            guard_free(section_name) +            guard_free(section_name);              continue;          } @@ -322,7 +322,7 @@ struct INIFILE *ini_open(const char *filename) {          // no data, skip          if (!reading_value && isempty(line)) { -            guard_free(value) +            guard_free(value);              continue;          } | 
