Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 6144b98

Browse files
Tan, Yew Waynephmccarty
authored andcommitted
Replace all tab indents with space indents
1 parent 5babb4f commit 6144b98

1 file changed

Lines changed: 42 additions & 42 deletions

File tree

src/server.c

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -104,43 +104,43 @@ static int avoid_dupes(const char *url)
104104
*/
105105
int configure_urls(void)
106106
{
107-
const char *env_var = getenv("CLR_DEBUGINFO_URLS");
108-
const char *token = env_var;
109-
int count = 0;
110-
char **urls_new = NULL;
111-
if (env_var) while (1) {
112-
int token_len = strcspn(token, " \t\n");
113-
if (token_len) {
114-
count++;
115-
urls_new = realloc(urls_new, count * sizeof(char*));
116-
if (!urls_new) { perror("realloc()"); exit(EXIT_FAILURE); }
117-
118-
char *url = calloc(token_len+1, sizeof(char));
119-
if (!url) { perror("calloc()"); exit(EXIT_FAILURE); }
120-
121-
urls_new[count-1] = strncpy(url, token, token_len);
122-
token += token_len;
123-
}
124-
if (*token == '\0') break;
125-
token++;
126-
}
127-
if (count) {
128-
// Abandon defaults
129-
urls = urls_new;
130-
urls_size = count;
131-
urlcounter = 0;
132-
}
133-
return count;
107+
const char *env_var = getenv("CLR_DEBUGINFO_URLS");
108+
const char *token = env_var;
109+
int count = 0;
110+
char **urls_new = NULL;
111+
if (env_var) while (1) {
112+
int token_len = strcspn(token, " \t\n");
113+
if (token_len) {
114+
count++;
115+
urls_new = realloc(urls_new, count * sizeof(char*));
116+
if (!urls_new) { perror("realloc()"); exit(EXIT_FAILURE); }
117+
118+
char *url = calloc(token_len+1, sizeof(char));
119+
if (!url) { perror("calloc()"); exit(EXIT_FAILURE); }
120+
121+
urls_new[count-1] = strncpy(url, token, token_len);
122+
token += token_len;
123+
}
124+
if (*token == '\0') break;
125+
token++;
126+
}
127+
if (count) {
128+
// Abandon defaults
129+
urls = urls_new;
130+
urls_size = count;
131+
urlcounter = 0;
132+
}
133+
return count;
134134
}
135135

136136
void free_urls(void)
137137
{
138-
if (urls != urls_default) {
139-
for (int i=0; i<urls_size; i++) {
140-
free(urls[i]);
141-
}
142-
free(urls);
143-
}
138+
if (urls != urls_default) {
139+
for (int i=0; i<urls_size; i++) {
140+
free(urls[i]);
141+
}
142+
free(urls);
143+
}
144144
}
145145

146146
#ifdef HAVE_ATOMIC_SUPPORT
@@ -462,14 +462,14 @@ int main(__nc_unused__ int argc, __nc_unused__ char **argv)
462462
struct passwd *passwdentry;
463463
const char *required_paths[] = { "/var/cache/debuginfo/lib", "/var/cache/debuginfo/src" };
464464

465-
if (configure_urls()) {
466-
fprintf(stderr, "Using urls from environment\n");
467-
} else {
468-
fprintf(stderr, "Using compiled default urls\n");
469-
}
470-
for (int i=0; i<urls_size; i++) {
471-
fprintf(stderr, "url: %s\n", urls[i]);
472-
}
465+
if (configure_urls()) {
466+
fprintf(stderr, "Using urls from environment\n");
467+
} else {
468+
fprintf(stderr, "Using compiled default urls\n");
469+
}
470+
for (int i=0; i<urls_size; i++) {
471+
fprintf(stderr, "url: %s\n", urls[i]);
472+
}
473473

474474
umask(0);
475475
passwdentry = getpwnam("dbginfo");
@@ -607,7 +607,7 @@ int main(__nc_unused__ int argc, __nc_unused__ char **argv)
607607
nc_hashmap_free(hash);
608608
}
609609

610-
free_urls();
610+
free_urls();
611611
}
612612

613613
/*

0 commit comments

Comments
 (0)