# HG changeset patch
# User Olaf Wintermann <olaf.wintermann@gmail.com>
# Date 1707384260 -3600
# Node ID d7942163a2a3cb453d4a3b2495d9d36271d11507
# Parent  3060a5a1d5fd82da40782a1106e431775f7b6c92
don't show progress percent when the file size is 0

diff -r 3060a5a1d5fd -r d7942163a2a3 application/davcontroller.c
--- 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) {