Update .clang-format

Align with wlroots style
This commit is contained in:
Johan Malm 2020-09-28 20:41:41 +01:00
parent 96b5ab1fc1
commit 96e05057a3
32 changed files with 669 additions and 515 deletions

View file

@ -10,19 +10,22 @@
#include <stdio.h>
char *grab_file(const char *filename)
char *
grab_file(const char *filename)
{
char *line = NULL;
size_t len = 0;
FILE *stream = fopen(filename, "r");
if (!stream)
if (!stream) {
return NULL;
}
struct buf buffer;
buf_init(&buffer);
while ((getline(&line, &len, stream) != -1)) {
char *p = strrchr(line, '\n');
if (p)
if (p) {
*p = '\0';
}
buf_add(&buffer, line);
}
free(line);