mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
Update .clang-format
Align with wlroots style
This commit is contained in:
parent
96b5ab1fc1
commit
96e05057a3
32 changed files with 669 additions and 515 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue