aboutsummaryrefslogtreecommitdiffstats
path: root/src/fbuilder/filedb.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/filedb.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/filedb.c')
-rw-r--r--src/fbuilder/filedb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fbuilder/filedb.c b/src/fbuilder/filedb.c
index b7162c2d6..6b57954d3 100644
--- a/src/fbuilder/filedb.c
+++ b/src/fbuilder/filedb.c
@@ -24,14 +24,14 @@ FileDB *filedb_find(FileDB *head, const char *fname) {
24 FileDB *ptr = head; 24 FileDB *ptr = head;
25 int found = 0; 25 int found = 0;
26 int len = strlen(fname); 26 int len = strlen(fname);
27 27
28 while (ptr) { 28 while (ptr) {
29 // exact name 29 // exact name
30 if (strcmp(fname, ptr->fname) == 0) { 30 if (strcmp(fname, ptr->fname) == 0) {
31 found = 1; 31 found = 1;
32 break; 32 break;
33 } 33 }
34 34
35 // parent directory in the list 35 // parent directory in the list
36 if (len > ptr->len && 36 if (len > ptr->len &&
37 fname[ptr->len] == '/' && 37 fname[ptr->len] == '/' &&
@@ -42,10 +42,10 @@ FileDB *filedb_find(FileDB *head, const char *fname) {
42 42
43 ptr = ptr->next; 43 ptr = ptr->next;
44 } 44 }
45 45
46 if (found) 46 if (found)
47 return ptr; 47 return ptr;
48 48
49 return NULL; 49 return NULL;
50} 50}
51 51
@@ -55,7 +55,7 @@ FileDB *filedb_add(FileDB *head, const char *fname) {
55 // don't add it if it is already there or if the parent directory is already in the list 55 // don't add it if it is already there or if the parent directory is already in the list
56 if (filedb_find(head, fname)) 56 if (filedb_find(head, fname))
57 return head; 57 return head;
58 58
59 // add a new entry 59 // add a new entry
60 FileDB *entry = malloc(sizeof(FileDB)); 60 FileDB *entry = malloc(sizeof(FileDB));
61 if (!entry) 61 if (!entry)