Use /**/ comments + minor style change

This commit is contained in:
Yorhel 2013-04-12 19:37:40 +02:00
parent dc316e26f5
commit 01f36e1beb
2 changed files with 5 additions and 7 deletions

View file

@ -216,7 +216,7 @@ static int rstring_esc(char **dest, int *destlen) {
ap(0xE0 | (n>>12)); ap(0xE0 | (n>>12));
ap(0x80 | ((n>>6) & 0x3F)); ap(0x80 | ((n>>6) & 0x3F));
ap(0x80 | (n & 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"); E(1, "Invalid character in \\u escape");
con(5); con(5);
break; break;

View file

@ -116,16 +116,14 @@ int has_cachedir_tag(const char *name) {
FILE *f; FILE *f;
int match = 0; int match = 0;
// Compute the required length for `path`. /* Compute the required length for `path`. */
l = strlen(name) + sizeof CACHEDIR_TAG_FILENAME + 2; l = strlen(name) + sizeof CACHEDIR_TAG_FILENAME + 2;
if((l > path_l) || (path == NULL)) { if(l > path_l || path == NULL) {
// We always at least double the size to prevent too frequent
// re-allocation.
path_l = path_l * 2; path_l = path_l * 2;
if(path_l < l) if(path_l < l)
path_l = l; path_l = l;
// We don't need to copy the content of `path`, so it's more efficient /* We don't need to copy the content of `path`, so it's more efficient to
// to use `free` + `malloc`. (Calling `free(NULL)` is allowed.) * use `free` + `malloc`. */
free(path); free(path);
path = malloc(path_l); path = malloc(path_l);
} }