Fix asprintf tc
authorjunmin kim <junmindd.kim@samsung.com>
Thu, 8 Jun 2017 08:52:45 +0000 (01:52 -0700)
committerjunmin kim <junmindd.kim@samsung.com>
Wed, 14 Jun 2017 07:12:45 +0000 (00:12 -0700)
Use asprintf, not avsprintf

apps/examples/testcase/le_tc/kernel/tc_libc_stdio.c

index 21d1a55..79e021b 100644 (file)
@@ -361,15 +361,13 @@ static void tc_libc_stdio_vfprintf(const char *format, ...)
 * Postconditions        :none
 * @return               :void
 */
-static void tc_libc_stdio_asprintf(const char *format, ...)
+static void tc_libc_stdio_asprintf(void)
 {
        int ret_chk;
        char *buffer;
-       va_list args;
 
-       va_start(args, format);
-       ret_chk = avsprintf(&buffer, format, args);
-       va_end(args);
+       ret_chk = asprintf(&buffer, "%s", printable_chars);
+
        TC_ASSERT_NOT_NULL("asprintf", buffer);
        TC_ASSERT_EQ_CLEANUP("asprintf",
                                                 ret_chk, strlen(printable_chars),
@@ -425,7 +423,7 @@ int libc_stdio_main(void)
        tc_libc_stdio_perror();
        tc_libc_stdio_printf();
        tc_libc_stdio_vfprintf("%s", printable_chars);
-       tc_libc_stdio_asprintf("%s", printable_chars);
+       tc_libc_stdio_asprintf();
        tc_libc_stdio_putchar();
 
        return 0;