]> granicus.if.org Git - check/commitdiff
Use casts when assigning a void*
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 23 Jun 2014 04:13:57 +0000 (04:13 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 23 Jun 2014 04:13:57 +0000 (04:13 +0000)
The changes are necessary for Check to compile with a c++ compiler.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1171 64e312b2-a51f-0410-8e61-82d0ca0eb02a

lib/snprintf.c

index 46735d49f814527a81b1615d95ab884709e15695..6032fe7dd95dc510593226e5fbb66ee11c46b7de 100644 (file)
@@ -850,7 +850,7 @@ rpl_vsnprintf(char *str, size_t size, const char *format, va_list args)
                                 * characters, in an implementation-defined
                                 * manner." (C99: 7.19.6.1, 8)
                                 */
-                               if ((strvalue = va_arg(args, void *)) == NULL)
+                               if ((strvalue = (const char *)va_arg(args, void *)) == NULL)
                                        /*
                                         * We use the glibc format.  BSD prints
                                         * "0x0", SysV "0".
@@ -1513,7 +1513,7 @@ rpl_vasprintf(char **ret, const char *format, va_list ap)
        VA_COPY(aq, ap);
        len = vsnprintf(NULL, 0, format, aq);
        VA_END_COPY(aq);
-       if (len < 0 || (*ret = malloc(size = len + 1)) == NULL)
+       if (len < 0 || (*ret = (char *)malloc(size = len + 1)) == NULL)
                return -1;
        return vsnprintf(*ret, size, format, ap);
 }