@@ -70,8 +70,12 @@ enum fARCH {
70
70
};
71
71
72
72
static gchar const APPIMAGEIGNORE [] = ".appimageignore" ;
73
- static char _exclude_file_desc [256 ];
74
73
74
+ // maximum size that the updateinformation's buffer can hold
75
+ // TODO: why 1024?
76
+ const int UPDATE_INFORMATION_BUFFER_SIZE = 1024 ;
77
+
78
+ static char _exclude_file_desc [256 ];
75
79
static gboolean list = FALSE;
76
80
static gboolean verbose = FALSE;
77
81
static gboolean showVersionOnly = FALSE;
@@ -825,7 +829,7 @@ main (int argc, char *argv[])
825
829
* should hopefully change that. */
826
830
827
831
fprintf (stderr , "Generating squashfs...\n" );
828
- const int buffer_size = 1024 ;
832
+
829
833
int size = 0 ;
830
834
831
835
@@ -873,7 +877,7 @@ main (int argc, char *argv[])
873
877
874
878
if (bintray_user != NULL ){
875
879
if (bintray_repo != NULL ){
876
- char buf [buffer_size ];
880
+ char buf [UPDATE_INFORMATION_BUFFER_SIZE ];
877
881
sprintf (buf , "bintray-zsync|%s|%s|%s|%s-_latestVersion-%s.AppImage.zsync" , bintray_user , bintray_repo , app_name_for_filename , app_name_for_filename , arch );
878
882
updateinformation = buf ;
879
883
printf ("%s\n" , updateinformation );
@@ -928,9 +932,9 @@ main (int argc, char *argv[])
928
932
} else {
929
933
channel = "continuous" ;
930
934
}
931
- int is_zsync_write_success = snprintf (buf , buffer_size , "gh-releases-zsync|%s|%s|%s|%s*-%s.AppImage.zsync" , parts [0 ], parts [1 ], channel , app_name_for_filename , arch );
935
+ int is_zsync_write_success = snprintf (buf , UPDATE_INFORMATION_BUFFER_SIZE , "gh-releases-zsync|%s|%s|%s|%s*-%s.AppImage.zsync" , parts [0 ], parts [1 ], channel , app_name_for_filename , arch );
932
936
if (is_zsync_write_success < 0 ) {
933
- printf ("Writing updateinformation failed. zsync information is too long. (> %d)\n" , buffer_size );
937
+ printf ("Writing updateinformation failed. zsync information is too long. (> %d)\n" , UPDATE_INFORMATION_BUFFER_SIZE );
934
938
exit (is_zsync_write_success );
935
939
}
936
940
updateinformation = buf ;
0 commit comments