summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2013-04-12 19:37:40 +0200
committerYorhel <git@yorhel.nl>2013-04-12 19:37:40 +0200
commit01f36e1bebbfbdd5d49ea7d10fdd4c8c57a52c36 (patch)
tree548aef8ca2ad48416cf383191ce96c71f9ad9acc
parentdc316e26f5de15181a2aef445e51dba075e81a93 (diff)
Use /**/ comments + minor style change
-rw-r--r--src/dir_import.c2
-rw-r--r--src/exclude.c10
2 files changed, 5 insertions, 7 deletions
diff --git a/src/dir_import.c b/src/dir_import.c
index 5d365f5..40a3a53 100644
--- a/src/dir_import.c
+++ b/src/dir_import.c
@@ -216,7 +216,7 @@ static int rstring_esc(char **dest, int *destlen) {
ap(0xE0 | (n>>12));
ap(0x80 | ((n>>6) & 0x3F));
ap(0x80 | (n & 0x3F));
- } else // this happens if there was an invalid character (n >= (1<<16))
+ } else /* this happens if there was an invalid character (n >= (1<<16)) */
E(1, "Invalid character in \\u escape");
con(5);
break;
diff --git a/src/exclude.c b/src/exclude.c
index 97183ad..2233f99 100644
--- a/src/exclude.c
+++ b/src/exclude.c
@@ -116,16 +116,14 @@ int has_cachedir_tag(const char *name) {
FILE *f;
int match = 0;
- // Compute the required length for `path`.
+ /* Compute the required length for `path`. */
l = strlen(name) + sizeof CACHEDIR_TAG_FILENAME + 2;
- if((l > path_l) || (path == NULL)) {
- // We always at least double the size to prevent too frequent
- // re-allocation.
+ if(l > path_l || path == NULL) {
path_l = path_l * 2;
if(path_l < l)
path_l = l;
- // We don't need to copy the content of `path`, so it's more efficient
- // to use `free` + `malloc`. (Calling `free(NULL)` is allowed.)
+ /* We don't need to copy the content of `path`, so it's more efficient to
+ * use `free` + `malloc`. */
free(path);
path = malloc(path_l);
}