Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=setup.git;a=commitdiff;h=feb5a511ead6fd1b6da8216519362ddec18b17df
commit feb5a511ead6fd1b6da8216519362ddec18b17df Author: James Buren <r...@frugalware.org> Date: Wed May 4 01:39:22 2011 -0500 fix swnum for partdisk diff --git a/src/plugins/partdisk.c b/src/plugins/partdisk.c index 0df3e87..6748745 100644 --- a/src/plugins/partdisk.c +++ b/src/plugins/partdisk.c @@ -112,7 +112,6 @@ GList *listparts(void) char *selpartsw() { #ifndef ARCH_PPC - int swnum=3; char *sws[] = { "cfdisk", _("User friendly (curses based) version of fdisk"), @@ -121,13 +120,18 @@ char *selpartsw() "parted", _("A partition manipulation program") }; #else - int swnum=2; char *sws[] = { "mac-fdisk", _("Apple disk partitioning utility"), "parted", _("A partition manipulation program") }; #endif + /* + Start with the size of the whole array of pointers. + Divide by the size of each pointer to get the number of pointers. + Divide by two to get the actual number of partition programs. + */ + int swnum = sizeof(sws) / sizeof(*sws) / 2; dialog_vars.backtitle=gen_backtitle(_("Creating partitions")); dlg_put_backtitle(); _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git