[PATCH 1/4] Don't use old pointer after realloc

Lubomir I. Ivanov neolit123 at gmail.com
Wed Dec 11 14:07:43 UTC 2013


On 11 December 2013 22:21, Anton Lundin <glance at acc.umu.se> wrote:
> +               *error = strdup("realloc failed in __func__\n");

^ BTW this should be in the lines of:

char cbuf[512];
snprintf((char *)&cbuf, sizeof(cbuf), "%s%s\n", "realloc failed in ", __func__);
char *s = strdup((const char *)&cbuf);

also __func__ is a predefined identifier by the translation unit in
c99 (6.4.2.2), so we can't use it as a macro with concatenation.

lubomir
--


More information about the subsurface mailing list