summaryrefslogtreecommitdiff
path: root/printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'printf.c')
-rw-r--r--printf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/printf.c b/printf.c
index 08a7831..da14fcc 100644
--- a/printf.c
+++ b/printf.c
@@ -303,10 +303,11 @@ int echo_main(int argc, char *argv[])
{
for (int i = 1; i < argc; i++) {
char ebuf[strlen(argv[i]) + 1];
+ memset(ebuf, '\0', sizeof(ebuf));
int quit = echo(argv[i], ebuf);
printf("%s", ebuf);
if (quit) {
- return(errors);
+ return errors;
}
putchar(i == argc - 1 ? '\n' : ' ');
}