Skip to content

Commit 81aac8b

Browse files
committed
fixed spelling, ran through the formatter
1 parent 35a2139 commit 81aac8b

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

src/cache.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ static int Meta_read(Cache *cf)
164164
}
165165

166166
if (sizeof(long) != fread(&cf->time, sizeof(long), 1, fp) ||
167-
sizeof(off_t) != fread(&cf->content_length, sizeof(off_t), 1, fp) ||
168-
sizeof(int) != fread(&cf->blksz, sizeof(int), 1, fp) ||
169-
sizeof(long) != fread(&cf->segbc, sizeof(long), 1, fp) ||
170-
ferror(fp)) {
167+
sizeof(off_t) != fread(&cf->content_length, sizeof(off_t), 1, fp) ||
168+
sizeof(int) != fread(&cf->blksz, sizeof(int), 1, fp) ||
169+
sizeof(long) != fread(&cf->segbc, sizeof(long), 1, fp) ||
170+
ferror(fp)) {
171171
lprintf(error, "error reading core metadata!\n");
172172
return EIO;
173173
}

src/link.c

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ LinkTable *LinkSystem_init(const char *url)
286286
* This is where the '/' should be
287287
*/
288288
ROOT_LINK_OFFSET = strnlen(url, MAX_PATH_LEN) -
289-
((url[url_len] == '/') ? 1 : 0);
289+
((url[url_len] == '/') ? 1 : 0);
290290

291291
/*
292292
* --------------------- Enable cache system --------------------
@@ -474,7 +474,7 @@ static void LinkTable_fill(LinkTable *linktbl)
474474
spaces in them!). If we only escaped it, and there were already
475475
encoded characters in it, then that would break the link. */
476476
char *unescaped_path = curl_easy_unescape(c, this_link->linkpath, 0,
477-
NULL);
477+
NULL);
478478
char *escaped_path = curl_easy_escape(c, unescaped_path, 0);
479479
curl_free(unescaped_path);
480480
/* Our code does the wrong thing if there's a trailing slash that's been
@@ -704,7 +704,10 @@ int LinkTable_disk_save(LinkTable *linktbl, const char *dirn)
704704
/* This is necessary to get the compiler on some platforms to stop
705705
complaining about the fact that we're not using the return value of
706706
fread, when we know we aren't and that's fine. */
707-
static inline void ignore_value(int i) { (void) i; }
707+
static inline void ignore_value(int i)
708+
{
709+
(void) i;
710+
}
708711

709712
LinkTable *LinkTable_disk_open(const char *dirn)
710713
{
@@ -1032,8 +1035,8 @@ range requests\n");
10321035
lprintf(error, "%s", curl_easy_strerror(ret));
10331036
}
10341037
if ((http_resp != HTTP_OK) &&
1035-
(http_resp != HTTP_PARTIAL_CONTENT) &&
1036-
(http_resp != HTTP_RANGE_NOT_SATISFIABLE)) {
1038+
(http_resp != HTTP_PARTIAL_CONTENT) &&
1039+
(http_resp != HTTP_RANGE_NOT_SATISFIABLE)) {
10371040
char *url;
10381041
curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url);
10391042
lprintf(warning, "Could not download %s, HTTP %ld\n", url, http_resp);
@@ -1064,7 +1067,9 @@ long Link_download(Link *link, char *output_buf, size_t req_size, off_t offset)
10641067
header.data = NULL;
10651068

10661069
if (offset + req_size > link->content_length) {
1067-
lprintf(error, "requested size to large, req_size: %lu, recv: %ld, content-length: %ld\n", req_size, recv, link->content_length);
1070+
lprintf(error,
1071+
"requested size too large, req_size: %lu, recv: %ld, content-length: %ld\n",
1072+
req_size, recv, link->content_length);
10681073
req_size = link->content_length - offset;
10691074
}
10701075

@@ -1146,14 +1151,14 @@ static void make_link_relative(const char *page_url, char *link_url)
11461151
page_url++;
11471152
}
11481153
if (slashes_left_to_find) {
1149-
if (slashes_left_to_find == 1 && ! *page_url)
1150-
/* We're at the top level of the web site and the user entered the URL
1151-
without a trailing slash. */
1152-
page_url = "/";
1153-
else
1154-
/* Well, that's odd. Let's return rather than trying to dig ourselves
1155-
deeper into whatever hole we're in. */
1156-
return;
1154+
if (slashes_left_to_find == 1 && ! *page_url)
1155+
/* We're at the top level of the web site and the user entered the URL
1156+
without a trailing slash. */
1157+
page_url = "/";
1158+
else
1159+
/* Well, that's odd. Let's return rather than trying to dig ourselves
1160+
deeper into whatever hole we're in. */
1161+
return;
11571162
}
11581163
/* The page URL is no longer the full page_url, it's just the part after
11591164
the host name. */

0 commit comments

Comments
 (0)