File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -779,8 +779,11 @@ chsrc_ensure_root ()
779779 if (0 != atoi (euid )) goto not_root ;
780780 else return ;
781781 }
782+
783+ char * msg = NULL ;
782784not_root :
783- char * msg = CliOpt_InEnglish ? "Use sudo before the command or switch to root to ensure the necessary permissions" : "请在命令前使用 sudo 或切换为root用户来保证必要的权限" ;
785+ msg = CliOpt_InEnglish ? "Use sudo before the command or switch to root to ensure the necessary permissions"
786+ : "请在命令前使用 sudo 或切换为root用户来保证必要的权限" ;
784787 chsrc_error (msg );
785788 exit (Exit_UserCause );
786789}
Original file line number Diff line number Diff line change @@ -300,9 +300,11 @@ _xy_str_to_terminal_style (int style, const char *str)
300300 color_fmt_str = "\e[9m%s\e[0m" ; break ;
301301 }
302302
303+
304+ size_t len = 0 ;
303305new_str :
304306 // -2 把中间%s减掉
305- size_t len = strlen (color_fmt_str ) - 2 ;
307+ len = strlen (color_fmt_str ) - 2 ;
306308 char * buf = malloc (strlen (str ) + len + 1 );
307309 sprintf (buf , color_fmt_str , str );
308310 return buf ;
You can’t perform that action at this time.
0 commit comments