LibBSD | rtemsbsd: Fix warnings in wpa_supplicant_fork (!123)
Aaron Nyholm (@eagleirony)
gitlab at rtems.org
Tue Feb 24 00:07:24 UTC 2026
Aaron Nyholm commented on a discussion on rtemsbsd/rtems/rtems-bsd-shell-wpa_supplicant_fork.c: https://gitlab.rtems.org/rtems/pkg/rtems-libbsd/-/merge_requests/123#note_143379
> - struct myparams *params = malloc(sizeof(struct myparams));
> + struct myparams *params = (struct myparams*)malloc(sizeof(struct myparams));
> if (params == NULL)
> - return NULL;
> + return -1;
>
> params->argc = argc;
> - params->argv = malloc((argc + 1) * sizeof(argv[0]));
> + params->argv = (char**)malloc((argc + 1) * sizeof(argv[0]));
> if (params->argv == NULL)
> - return NULL;
> + return -1;
>
> for (i = 0; i < argc; i++) {
> - params->argv[i] = strdup(argv[i]);
> + params->argv[i] = (char*)strdup(argv[i]);
Your right. Wrong fix, missing a header file.
--
View it on GitLab: https://gitlab.rtems.org/rtems/pkg/rtems-libbsd/-/merge_requests/123#note_143379
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260224/2282510a/attachment-0001.htm>
More information about the bugs
mailing list