Re: [rhel5-branch 4/4] Shorten long NIC descriptions to 60.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> @@ -2212,10 +2214,17 @@ int chooseNetworkInterface(struct loaderData_s * loaderData) {
>          if (!devs[i]->device)
>              continue;
>          if (devs[i]->desc) {
> +                if (strlen(devs[i]->desc) < MAX_DESC) {
> +                    strcpy(desc, devs[i]->desc);
> +                } else {
> +                    strncpy(desc, devs[i]->desc, MAX_DESC);
> +                    desc[MAX_DESC - 4] = '\0';
> +                    strcat(desc, "...");
> +                }
>                  deviceNames[deviceNums] = alloca(strlen(devs[i]->device) +
> -                                          strlen(devs[i]->desc) + 4);
> +                                                 strlen(desc) + 4);
>                  sprintf(deviceNames[deviceNums],"%s - %s",
> -                        devs[i]->device, devs[i]->desc);
> +                        devs[i]->device, desc);
>                  if (strlen(deviceNames[deviceNums]) > max)
>                          max = strlen(deviceNames[deviceNums]);
>                  devices[deviceNums++] = devs[i]->device;

I'm a little concerned here that the most useful identifying information
will end up at the end of the description, therefore chopped off.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux