Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conform to C90 standard so compilation works on older distributions #299

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading