diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-08-15 16:54:55 +0100 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-08-22 10:26:04 +0100 |
commit | 7addcb33ef7b27cbc6f5802194c48d1f5736011d (patch) | |
tree | 1df788981b4bc22ebc4f9e423153054c0a1c5964 /lib/libc/printf.c | |
parent | 90f2d452a860adef46dde22ddaf39811a0a43c5d (diff) |
libc: Remove printf-like functions
They are too big for the Trusted Firmware, and it can be confusing to
have two versions of the same functions with different names. tf_printf
and tf_snprintf will replace them in the next patch.
Change-Id: I978414ac169cc3156e249549ef101a70eb31a295
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'lib/libc/printf.c')
-rw-r--r-- | lib/libc/printf.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/libc/printf.c b/lib/libc/printf.c deleted file mode 100644 index f6156414..00000000 --- a/lib/libc/printf.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include <stdio.h> -#include <stdarg.h> - -/* Choose max of 128 chars for now. */ -#define PRINT_BUFFER_SIZE 128 -int printf(const char *fmt, ...) -{ - va_list args; - char buf[PRINT_BUFFER_SIZE]; - int count; - - va_start(args, fmt); - vsnprintf(buf, sizeof(buf) - 1, fmt, args); - va_end(args); - - /* Use putchar directly as 'puts()' adds a newline. */ - buf[PRINT_BUFFER_SIZE - 1] = '\0'; - count = 0; - while (buf[count]) - { - if (putchar(buf[count]) != EOF) { - count++; - } else { - count = EOF; - break; - } - } - - return count; -} |