Thu, 08 Feb 2024 10:24:20 +0100
don't show progress percent when the file size is 0
application/davcontroller.c | file | annotate | diff | comparison | revisions |
--- a/application/davcontroller.c Thu Feb 08 10:22:58 2024 +0100 +++ b/application/davcontroller.c Thu Feb 08 10:24:20 2024 +0100 @@ -301,11 +301,11 @@ free(sz_total); free(label1.ptr); - - cxmutstr file_label = cx_asprintf("%s (%.0f%%)", upload->current_file_name, ((float)upload->current_file_upload/(float)upload->current_file_size)*100); - ui_set(upload->label_top_right, file_label.ptr); - - free(file_label.ptr); + if (upload->current_file_size > 0) { + cxmutstr file_label = cx_asprintf("%s (%.0f%%)", upload->current_file_name, ((float)upload->current_file_upload/(float)upload->current_file_size)*100); + ui_set(upload->label_top_right, file_label.ptr); + free(file_label.ptr); + } } static int uithr_update_upload_labels(void *data) {