Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Commit b5a0c78

Browse files
committed
use null-terminated array to stop segfaults
1 parent 31daacc commit b5a0c78

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Services/Downloader.vala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,9 @@ namespace Downloader {
145145
button.get_style_context ().remove_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION);
146146

147147
installed_list.remove (name);
148-
string[] validated = {};
149-
foreach (string item in installed_list) {
150-
validated += item.make_valid ();
151-
}
152-
Docs.settings.set_strv ("packages", validated);
148+
string[] packages = installed_list.to_array ();
149+
packages += null;
150+
Docs.settings.set_strv ("packages", packages);
153151
} else {
154152
download (name);
155153
decompress (name);
@@ -159,7 +157,9 @@ namespace Downloader {
159157
button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION);
160158

161159
installed_list.add (name);
162-
Docs.settings.set_strv ("packages", installed_list.to_array ());
160+
string[] packages = installed_list.to_array ();
161+
packages += null;
162+
Docs.settings.set_strv ("packages", packages);
163163
}
164164
}
165165

0 commit comments

Comments
 (0)