Skip to content

Commit fc14570

Browse files
committed
installer: Fix crash after 2x trying to install on source partition.
Fun bug.
1 parent ddea2f6 commit fc14570

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

installer/install.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ static util_Partition *inst_showPartitionSelector(util_HardDiskArray *hdds) {
155155
char **menuLabels = NULL;
156156
int menuResult;
157157
util_Partition *result = NULL;
158-
char chosenOption[256] = "/dev/";
158+
const char devPrefix[] = "/dev/";
159+
char chosenOption[256] = "";
159160

160161
while (1) {
161162
menuLabels = ui_allocateDialogMenuLabelList(0);
@@ -188,7 +189,7 @@ static util_Partition *inst_showPartitionSelector(util_HardDiskArray *hdds) {
188189

189190
menuResult = ui_showMenu("Select the partition you wish to install to.", menuLabels, true);
190191

191-
strncat(chosenOption, ui_getMenuResultString(), sizeof(chosenOption) - strlen(chosenOption));
192+
snprintf(chosenOption, sizeof(chosenOption), "%s%s", devPrefix, ui_getMenuResultString());
192193

193194
if (menuResult == UI_MENU_CANCELED) { // BACK was pressed.
194195
return NULL;

0 commit comments

Comments
 (0)