Re: [PATCH 1/2] static-nodes: don't fail if modules.devname not found

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

 



On Sun, Jul 14, 2013 at 1:56 PM, Tom Gundersen <teg@xxxxxxx> wrote:

> @@ -170,13 +171,8 @@ static int do_static_nodes(int argc, char *argv[])
>                 }
>                 switch (c) {
>                 case 'o':
> -                       out = fopen(optarg, "we");
> -                       if (out == NULL) {
> -                               fprintf(stderr, "Error: could not create %s!\n",
> -                                       optarg);
> -                               ret = EXIT_FAILURE;
> -                               goto finish;
> -                       }
> +                       strncpy(output, optarg, PATH_MAX);

Not relevant for any common use case, but strncpy() sucks and will not
terminate with '\0', so we should probably just always add a '\0' to
the end.

Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux