aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2018-07-14 12:52:05 +0200
committerLibravatar smitsohu <smitsohu@gmail.com>2018-07-14 12:52:05 +0200
commit5c69440cc943f530830b8534d99d2061bdcfaf40 (patch)
treea1eba2a632b2671c11ff3da1d2ade784f31f903e /src
parentfix empty spaces in mountinfo fields (diff)
downloadfirejail-5c69440cc943f530830b8534d99d2061bdcfaf40.tar.gz
firejail-5c69440cc943f530830b8534d99d2061bdcfaf40.tar.zst
firejail-5c69440cc943f530830b8534d99d2061bdcfaf40.zip
minor improvements to previous commit 949b924fba58dc05f1c21d6621f05047be5397f0
Diffstat (limited to 'src')
-rw-r--r--src/firejail/util.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/firejail/util.c b/src/firejail/util.c
index 54e59d7d2..52db987b7 100644
--- a/src/firejail/util.c
+++ b/src/firejail/util.c
@@ -1058,20 +1058,19 @@ static void unmangle_path(char *path) {
1058 worker = p + i; 1058 worker = p + i;
1059 // there are always three octal digits 1059 // there are always three octal digits
1060 if (*worker < '0' || *worker > '7') { 1060 if (*worker < '0' || *worker > '7') {
1061 fprintf(stderr, "Error: bad escape sequence\n"); 1061 fprintf(stderr, "Error: cannot read /proc/self/mountinfo\n");
1062 exit(1); 1062 exit(1);
1063 } 1063 }
1064 decimal += *worker - '0'; 1064 decimal = (*worker - '0' + decimal) * 8;
1065 if (i < 3)
1066 decimal *= 8;
1067 } 1065 }
1066 decimal /= 8;
1068 // do the replacement 1067 // do the replacement
1069 if (decimal == ' ') { 1068 if (decimal == ' ') {
1070 *p = ' '; 1069 *p = ' ';
1071 worker = p; 1070 worker = p;
1072 do { 1071 do {
1073 worker++; 1072 worker++;
1074 *worker = *(worker + 3); 1073 *worker = *(worker + 3);
1075 } while (*worker); 1074 } while (*worker);
1076 } 1075 }
1077 1076