15
15
* along with MultiROM. If not, see <http://www.gnu.org/licenses/>.
16
16
*/
17
17
18
- #include <sys/stat.h>
18
+ #include <sys/stat.h>
19
19
#include <fcntl.h>
20
20
#include <stdio.h>
21
21
#include <string.h>
22
22
#include <dirent.h>
23
- #include <sys/types.h>
23
+ #include <sys/types.h>
24
24
#include <sys/wait.h>
25
25
#include <stdlib.h>
26
26
#include <errno.h>
@@ -252,6 +252,7 @@ void multirom_emergency_reboot(void)
252
252
fb_text_proto * p ;
253
253
fb_img * t ;
254
254
char * tail ;
255
+ char * last_end ;
255
256
int cur_y ;
256
257
if (multirom_init_fb (0 ) < 0 )
257
258
{
@@ -271,21 +272,24 @@ void multirom_emergency_reboot(void)
271
272
fb_add_rect (0 , t -> y + t -> h + 5 * DPI_MUL , fb_width , 1 , GRAYISH );
272
273
273
274
tail = klog + strlen (klog );
275
+ last_end = tail ;
274
276
cur_y = fb_height ;
275
277
const int start_y = (t -> y + t -> h + 2 );
276
278
while (tail > klog )
277
279
{
278
280
-- tail ;
279
281
if (* tail == '\n' )
280
282
{
281
- * tail = 0 ;
282
-
283
- p = fb_text_create (0 , cur_y , GRAYISH , 4 , tail + 1 );
283
+ p = fb_text_create (0 , cur_y , GRAYISH , 4 * 4 , NULL );
284
+ p -> text = malloc (last_end - tail );
285
+ memcpy (p -> text , tail + 1 , last_end - (tail + 1 ));
286
+ p -> text [last_end - (tail + 1 )] = 0 ;
284
287
p -> style = STYLE_MONOSPACE ;
285
288
t = fb_text_finalize (p );
286
289
287
290
cur_y -= t -> h ;
288
291
t -> y = cur_y ;
292
+ last_end = tail ;
289
293
290
294
if (cur_y < start_y )
291
295
{
@@ -875,7 +879,7 @@ void multirom_import_internal(void)
875
879
char path [256 ];
876
880
877
881
// multirom
878
- mkdir (multirom_dir , 0777 );
882
+ mkdir (multirom_dir , 0777 );
879
883
880
884
// roms
881
885
snprintf (path , sizeof (path ), "%s/roms" , multirom_dir );
@@ -1169,7 +1173,7 @@ int multirom_prep_android_mounts(struct multirom_rom *rom)
1169
1173
if (has_fw )
1170
1174
mkdir_with_perms ("/firmware" , 0771 , "system" , "system" );
1171
1175
1172
- static const char * folders [2 ][3 ] =
1176
+ static const char * folders [2 ][3 ] =
1173
1177
{
1174
1178
{ "system" , "data" , "cache" },
1175
1179
{ "system.img" , "data.img" , "cache.img" },
@@ -1277,7 +1281,8 @@ int multirom_process_android_fstab(char *fstab_name, int has_fw, struct fstab_pa
1277
1281
if (!tab )
1278
1282
goto exit ;
1279
1283
1280
- if (fstab_disable_part (tab , "/system" ) || fstab_disable_part (tab , "/data" ) || fstab_disable_part (tab , "/cache" ))
1284
+ const int disable_res = fstab_disable_part (tab , "/system" ) + fstab_disable_part (tab , "/data" ) + fstab_disable_part (tab , "/cache" );
1285
+ if (disable_res != 0 )
1281
1286
{
1282
1287
#if MR_DEVICE_HOOKS >= 4
1283
1288
if (!mrom_hook_allow_incomplete_fstab ())
0 commit comments