aboutsummaryrefslogtreecommitdiffstats
path: root/src/fbuilder/build_bin.c
diff options
context:
space:
mode:
authorLibravatar Fred-Barclay <Fred-Barclay@users.noreply.github.com>2017-11-19 15:02:42 -0600
committerLibravatar Fred-Barclay <Fred-Barclay@users.noreply.github.com>2017-11-19 15:02:42 -0600
commitb936e5ab77dfa0b54b2f6f6dd53762a8244e4230 (patch)
treeedb7237ba54d7c2a85a8531c8901d6466c5e0e4d /src/fbuilder/build_bin.c
parentMore qtox profile tightening (diff)
downloadfirejail-b936e5ab77dfa0b54b2f6f6dd53762a8244e4230.tar.gz
firejail-b936e5ab77dfa0b54b2f6f6dd53762a8244e4230.tar.zst
firejail-b936e5ab77dfa0b54b2f6f6dd53762a8244e4230.zip
strip trailing whitespace
Diffstat (limited to 'src/fbuilder/build_bin.c')
-rw-r--r--src/fbuilder/build_bin.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/fbuilder/build_bin.c b/src/fbuilder/build_bin.c
index fb92fb630..b69e089c3 100644
--- a/src/fbuilder/build_bin.c
+++ b/src/fbuilder/build_bin.c
@@ -23,21 +23,21 @@ static FileDB *bin_out = NULL;
23 23
24static void process_bin(const char *fname) { 24static void process_bin(const char *fname) {
25 assert(fname); 25 assert(fname);
26 26
27 // process trace file 27 // process trace file
28 FILE *fp = fopen(fname, "r"); 28 FILE *fp = fopen(fname, "r");
29 if (!fp) { 29 if (!fp) {
30 fprintf(stderr, "Error: cannot open %s\n", fname); 30 fprintf(stderr, "Error: cannot open %s\n", fname);
31 exit(1); 31 exit(1);
32 } 32 }
33 33
34 char buf[MAX_BUF]; 34 char buf[MAX_BUF];
35 while (fgets(buf, MAX_BUF, fp)) { 35 while (fgets(buf, MAX_BUF, fp)) {
36 // remove \n 36 // remove \n
37 char *ptr = strchr(buf, '\n'); 37 char *ptr = strchr(buf, '\n');
38 if (ptr) 38 if (ptr)
39 *ptr = '\0'; 39 *ptr = '\0';
40 40
41 // parse line: 4:galculator:access /etc/fonts/conf.d:0 41 // parse line: 4:galculator:access /etc/fonts/conf.d:0
42 // number followed by : 42 // number followed by :
43 ptr = buf; 43 ptr = buf;
@@ -89,7 +89,7 @@ static void process_bin(const char *fname) {
89 89
90 bin_out = filedb_add(bin_out, ptr); 90 bin_out = filedb_add(bin_out, ptr);
91 } 91 }
92 92
93 fclose(fp); 93 fclose(fp);
94} 94}
95 95
@@ -97,10 +97,10 @@ static void process_bin(const char *fname) {
97// process fname, fname.1, fname.2, fname.3, fname.4, fname.5 97// process fname, fname.1, fname.2, fname.3, fname.4, fname.5
98void build_bin(const char *fname, FILE *fp) { 98void build_bin(const char *fname, FILE *fp) {
99 assert(fname); 99 assert(fname);
100 100
101 // run fname 101 // run fname
102 process_bin(fname); 102 process_bin(fname);
103 103
104 // run all the rest 104 // run all the rest
105 struct stat s; 105 struct stat s;
106 int i; 106 int i;