@@ -204,7 +204,7 @@ gchar* get_desktop_entry(GKeyFile *kf, char *key) {
204
204
* line is large enough to hold the resulting string*/
205
205
static void replacestr (char * line , const char * search , const char * replace )
206
206
{
207
- char * sp ;
207
+ char * sp = NULL ;
208
208
209
209
if ((sp = strstr (line , search )) == NULL ) {
210
210
return ;
@@ -236,8 +236,8 @@ static GOptionEntry entries[] =
236
236
{ "sign" , 's' , 0 , G_OPTION_ARG_NONE , & sign , "Sign with gpg2" , NULL },
237
237
{ "comp" , 0 , 0 , G_OPTION_ARG_STRING , & sqfs_comp , "Squashfs compression" , NULL },
238
238
{ "no-appstream" , 'n' , 0 , G_OPTION_ARG_NONE , & no_appstream , "Do not check AppStream metadata" , NULL },
239
- { G_OPTION_REMAINING , 0 , 0 , G_OPTION_ARG_FILENAME_ARRAY , & remaining_args , NULL },
240
- { NULL }
239
+ { G_OPTION_REMAINING , 0 , 0 , G_OPTION_ARG_FILENAME_ARRAY , & remaining_args , NULL , NULL },
240
+ { 0 , 0 , 0 , 0 , 0 , 0 , 0 }
241
241
};
242
242
243
243
int
@@ -400,7 +400,7 @@ main (int argc, char *argv[])
400
400
fprintf (stdout , "%s should be packaged as %s\n" , source , destination );
401
401
/* Check if the Icon file is how it is expected */
402
402
gchar * icon_name = get_desktop_entry (kf , "Icon" );
403
- gchar * icon_file_path ;
403
+ gchar * icon_file_path = NULL ;
404
404
gchar * icon_file_png ;
405
405
gchar * icon_file_svg ;
406
406
gchar * icon_file_svgz ;
@@ -409,15 +409,15 @@ main (int argc, char *argv[])
409
409
icon_file_svg = g_strdup_printf ("%s/%s.svg" , source , icon_name );
410
410
icon_file_svgz = g_strdup_printf ("%s/%s.svgz" , source , icon_name );
411
411
icon_file_xpm = g_strdup_printf ("%s/%s.xpm" , source , icon_name );
412
- if (g_file_test (icon_file_png , G_FILE_TEST_IS_REGULAR ))
412
+ if (g_file_test (icon_file_png , G_FILE_TEST_IS_REGULAR )) {
413
413
icon_file_path = icon_file_png ;
414
- if (g_file_test (icon_file_svg , G_FILE_TEST_IS_REGULAR ))
414
+ } else if (g_file_test (icon_file_svg , G_FILE_TEST_IS_REGULAR )) {
415
415
icon_file_path = icon_file_svg ;
416
- if (g_file_test (icon_file_svgz , G_FILE_TEST_IS_REGULAR ))
416
+ } else if (g_file_test (icon_file_svgz , G_FILE_TEST_IS_REGULAR )) {
417
417
icon_file_path = icon_file_svgz ;
418
- if (g_file_test (icon_file_xpm , G_FILE_TEST_IS_REGULAR ))
418
+ } else if (g_file_test (icon_file_xpm , G_FILE_TEST_IS_REGULAR )) {
419
419
icon_file_path = icon_file_xpm ;
420
- if (! g_file_test ( icon_file_path , G_FILE_TEST_IS_REGULAR )) {
420
+ } else {
421
421
fprintf (stderr , "%s{.png,.svg,.svgz,.xpm} not present but defined in desktop file\n" , icon_name );
422
422
exit (1 );
423
423
}
@@ -548,10 +548,10 @@ main (int argc, char *argv[])
548
548
unsigned long ui_offset = 0 ;
549
549
unsigned long ui_length = 0 ;
550
550
get_elf_section_offset_and_lenghth (destination , ".upd_info" , & ui_offset , & ui_length );
551
- if (verbose )
551
+ if (verbose ) {
552
552
printf ("ui_offset: %lu\n" , ui_offset );
553
- if (verbose )
554
553
printf ("ui_length: %lu\n" , ui_length );
554
+ }
555
555
if (ui_offset == 0 ) {
556
556
die ("Could not determine offset for updateinformation" );
557
557
} else {
@@ -617,10 +617,10 @@ main (int argc, char *argv[])
617
617
unsigned long sig_offset = 0 ;
618
618
unsigned long sig_length = 0 ;
619
619
get_elf_section_offset_and_lenghth (destination , ".sha256_sig" , & sig_offset , & sig_length );
620
- if (verbose )
620
+ if (verbose ) {
621
621
printf ("sig_offset: %lu\n" , sig_offset );
622
- if (verbose )
623
622
printf ("sig_length: %lu\n" , sig_length );
623
+ }
624
624
if (sig_offset == 0 ) {
625
625
die ("Could not determine offset for signature" );
626
626
} else {
0 commit comments