application/davcontroller.c

changeset 22
d7942163a2a3
parent 21
3060a5a1d5fd
child 24
12ad3393c151
--- 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) {

mercurial