Skip to content

Commit

Permalink
Conform to C90 standard
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronAtDuo committed Oct 23, 2024
1 parent 8d65a82 commit e3f3623
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ duo_common_ini_handler(struct duo_config *cfg, const char *section,
cfg->http_proxy = strdup(val);
} else if (strcmp(name, "groups") == 0 || strcmp(name, "group") == 0) {
size_t len = strlen(val);
size_t j = 0;
size_t i = 0, j = 0;
int inEscape = 0;
char *currWord;
if ((currWord = malloc(len + 1)) == NULL) {
fprintf(stderr, "Out of memory parsing groups\n");
return (0);
}

for (size_t i = 0; i <= len; ++i) {
for (i = 0; i <= len; ++i) {
if (val[i] == '\\' && val[i + 1] == ' ' && !inEscape) {
inEscape = 1;
continue;
Expand Down Expand Up @@ -206,7 +206,8 @@ close_config(struct duo_config *cfg)
void
cleanup_config_groups(struct duo_config *cfg)
{
for (int i = 0; i < MAX_GROUPS; ++i) {
int i = 0;
for (i = 0; i < MAX_GROUPS; ++i) {
if (cfg->groups[i] != NULL) {
free(cfg->groups[i]);
cfg->groups[i] = NULL;
Expand Down

0 comments on commit e3f3623

Please sign in to comment.