Skip to content

Commit c7cd05e

Browse files
committed
format
1 parent 03cf5a5 commit c7cd05e

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/libmongoc/src/mongoc/mongoc-secure-channel.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,33 @@
4444
// `read_file_and_null_terminate` reads a file into a NUL-terminated string.
4545
// On success: returns a NUL-terminated string and (optionally) sets `*out_len` excluding NUL.
4646
// On error: returns NULL.
47-
static char* read_file_and_null_terminate (const char* filename, size_t *out_len) {
47+
static char *
48+
read_file_and_null_terminate (const char *filename, size_t *out_len)
49+
{
4850
BSON_ASSERT_PARAM (filename);
4951
BSON_OPTIONAL_PARAM (out_len);
5052

5153
bool ok = false;
52-
char* contents = NULL;
54+
char *contents = NULL;
5355
char errmsg_buf[BSON_ERROR_BUFFER_SIZE];
5456

55-
FILE* file = fopen (filename, "rb");
57+
FILE *file = fopen (filename, "rb");
5658
if (!file) {
57-
MONGOC_ERROR ("Failed to open file: '%s' with error: '%s'", bson_strerror_r (errno, errmsg_buf, sizeof errmsg_buf));
59+
MONGOC_ERROR ("Failed to open file: '%s' with error: '%s'",
60+
bson_strerror_r (errno, errmsg_buf, sizeof errmsg_buf));
5861
goto fail;
5962
}
6063

6164
if (0 != fseek (file, 0, SEEK_END)) {
62-
MONGOC_ERROR ("Failed to seek in file: '%s' with error: '%s'", bson_strerror_r (errno, errmsg_buf, sizeof errmsg_buf));
65+
MONGOC_ERROR ("Failed to seek in file: '%s' with error: '%s'",
66+
bson_strerror_r (errno, errmsg_buf, sizeof errmsg_buf));
6367
goto fail;
6468
}
6569

6670
long file_len = ftell (file);
6771
if (file_len < 0) {
68-
MONGOC_ERROR ("Failed to get length of file: '%s' with error: '%s'", bson_strerror_r (errno, errmsg_buf, sizeof errmsg_buf));
72+
MONGOC_ERROR ("Failed to get length of file: '%s' with error: '%s'",
73+
bson_strerror_r (errno, errmsg_buf, sizeof errmsg_buf));
6974
goto fail;
7075
}
7176

@@ -75,7 +80,8 @@ static char* read_file_and_null_terminate (const char* filename, size_t *out_len
7580
}
7681

7782
if (0 != fseek (file, 0, SEEK_SET)) {
78-
MONGOC_ERROR ("Failed to seek in file: '%s' with error: '%s'", bson_strerror_r (errno, errmsg_buf, sizeof errmsg_buf));
83+
MONGOC_ERROR ("Failed to seek in file: '%s' with error: '%s'",
84+
bson_strerror_r (errno, errmsg_buf, sizeof errmsg_buf));
7985
goto fail;
8086
}
8187

@@ -87,7 +93,8 @@ static char* read_file_and_null_terminate (const char* filename, size_t *out_len
8793
MONGOC_ERROR ("Unexpected EOF reading file: '%s'", filename);
8894
goto fail;
8995
} else {
90-
MONGOC_ERROR ("Failed to read file: '%s' with error: '%s'", bson_strerror_r (errno, errmsg_buf, sizeof errmsg_buf));
96+
MONGOC_ERROR ("Failed to read file: '%s' with error: '%s'",
97+
bson_strerror_r (errno, errmsg_buf, sizeof errmsg_buf));
9198
goto fail;
9299
}
93100
}

0 commit comments

Comments
 (0)