From: Ben Pfaff Date: Mon, 25 Oct 2004 00:13:24 +0000 (+0000) Subject: Improve implementation of puts(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=commitdiff_plain;h=280146e14d69a814a81db2c09bf33b395c542ead Improve implementation of puts(). --- diff --git a/src/lib/user/console.c b/src/lib/user/console.c index d2b9dc7..22bdc8c 100644 --- a/src/lib/user/console.c +++ b/src/lib/user/console.c @@ -1,4 +1,5 @@ #include +#include #include #include @@ -29,8 +30,7 @@ hprintf (int handle, const char *format, ...) int puts (const char *s) { - while (*s != '\0') - putchar (*s++); + write (STDOUT_FILENO, s, strlen (s)); putchar ('\n'); return 0;