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

Re: Subject: [PATCH] explicit cast to char*


On 8 March 2017 at 08:23, Max Noppel <max@noppelmax.online> wrote:
> From 80933a4a6962c269ca1a6f9804498716789d219b Mon Sep 17 00:00:00 2001
> From: noppel <noppel@xxxxxxxxxxxxx>
> Date: Wed, 8 Mar 2017 09:22:23 +0100
> Subject: [PATCH] explicit cast to char*
>
> ---
>  src/cmocka.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/cmocka.c b/src/cmocka.c
> index b91dd65..f66e569 100644
> --- a/src/cmocka.c
> +++ b/src/cmocka.c
> @@ -1783,7 +1783,7 @@ static void vcm_print_error(const char* const format,
> va_list args)
>      if (cm_error_message == NULL) {
>          /* CREATE MESSAGE */
>
> -        cm_error_message = libc_malloc(len + 1);
> +        cm_error_message = (char*)libc_malloc(len + 1);
>          if (cm_error_message == NULL) {
>              /* TODO */
>              goto end;
> @@ -1793,7 +1793,7 @@ static void vcm_print_error(const char* const format,
> va_list args)
>          char *tmp;
>
>          msg_len = strlen(cm_error_message);
> -        tmp = libc_realloc(cm_error_message, msg_len + len + 1);
> +        tmp = (char*)libc_realloc(cm_error_message, msg_len + len + 1);

Hi Max,

Disclaimer: I'm not a cmocka core dev/maintainer.

Based on your patches seems like you're using a C++ compiler for these
C files, which generally is a bad idea.
Patches should be safe as-is though, just very strange ;-)

-Emil


Follow-Ups:
Re: Subject: [PATCH] explicit cast to char*Maximilian Noppel <max@noppelmax.online>
References:
Subject: [PATCH] explicit cast to char*Max Noppel <max@noppelmax.online>