Index: soft/giet_vm/libs/stdio.c
===================================================================
--- soft/giet_vm/libs/stdio.c	(revision 237)
+++ soft/giet_vm/libs/stdio.c	(revision 238)
@@ -103,5 +103,6 @@
 // This function returns the local processor time (clock cycles since boot)
 ////////////////////////////////////////////////////////////////////////////////////
-unsigned int giet_proctime() {
+unsigned int giet_proctime() 
+{
     return sys_call(SYSCALL_PROCTIME, 0, 0, 0, 0);
 }
@@ -118,5 +119,6 @@
 // - Returns 1 if the character has been written, 0 otherwise.
 ////////////////////////////////////////////////////////////////////////////////////
-unsigned int giet_tty_putc(char byte) {
+unsigned int giet_tty_putc(char byte) 
+{
     return sys_call(SYSCALL_TTY_WRITE, (unsigned int) (&byte), 1, 0, 0);
 }
@@ -132,9 +134,8 @@
 // - Returns the number of written characters.
 ////////////////////////////////////////////////////////////////////////////////////
-unsigned int giet_tty_puts(char * buf) {
+unsigned int giet_tty_puts(char * buf) 
+{
     unsigned int length = 0;
-    while (buf[length] != 0) {
-        length++;
-    }
+    while (buf[length] != 0) { length++; }
     return sys_call(SYSCALL_TTY_WRITE, (unsigned int) buf, length, 0, 0);
 }
@@ -149,8 +150,10 @@
 // Returns the number of written characters (should be equal to ten).
 ////////////////////////////////////////////////////////////////////////////////////
-unsigned int giet_tty_putw(unsigned int val) {
+unsigned int giet_tty_putw(unsigned int val) 
+{
     char buf[10];
     unsigned int i;
-    for (i = 0; i < 10; i++) {
+    for (i = 0; i < 10; i++) 
+    {
         buf[9 - i] = (val % 10) + 0x30;
         val = val / 10;
@@ -168,7 +171,9 @@
 // - Returns 0 when completed.
 ////////////////////////////////////////////////////////////////////////////////////
-unsigned int giet_tty_getc(char * byte) {
+unsigned int giet_tty_getc(char * byte) 
+{
     unsigned int ret = 0;
-    while (ret == 0) {
+    while (ret == 0) 
+    {
         ret = sys_call(SYSCALL_TTY_READ, (unsigned int)byte, 1, 0, 0);
     }
@@ -187,26 +192,31 @@
 //   will be copied into buffer, and the string is always completed by a NUL
 //   character.
-// - The <LF> character is interpreted, as the function close the string with a
+// - The <LF> character is interpreted, and the function close the string with a
 //   NUL character if <LF> is read.
 // - The <DEL> character is interpreted, and the corresponding character(s) are
 //   removed from the target buffer.
 ////////////////////////////////////////////////////////////////////////////////////
-unsigned int giet_tty_gets(char * buf, unsigned int bufsize) {
+unsigned int giet_tty_gets( char*        buf, 
+                            unsigned int bufsize) 
+{
     unsigned int ret;
     unsigned char byte;
     unsigned int index = 0;
 
-    while (index < (bufsize - 1)) {
-        do {
-            ret = sys_call(SYSCALL_TTY_READ, (unsigned int) (&byte), 1, 0, 0);
-        } while (ret != 1);
-
-        if (byte == 0x0A) {
-            break; /* LF */
-        }
-        else if ((byte == 0x7F) && (index > 0)) {
-            index--; /* DEL */
-        }
-        else {
+    while (index < (bufsize - 1)) 
+    {
+        do { ret = sys_call(SYSCALL_TTY_READ, (unsigned int) (&byte), 1, 0, 0); } 
+        while (ret != 1);
+
+        if (byte == 0x0A)  /* LF */
+        {
+            break; 
+        }
+        else if ((byte == 0x7F) && (index > 0))  /* DEL */
+        {
+            index--; 
+        }
+        else 
+        {
             buf[index] = byte;
             index++;
@@ -236,5 +246,6 @@
 //   bits range, the zero value is returned.
 ////////////////////////////////////////////////////////////////////////////////////
-unsigned int giet_tty_getw(unsigned int * val) {
+unsigned int giet_tty_getw(unsigned int * val) 
+{
     unsigned char buf[32];
     unsigned char byte;
@@ -247,23 +258,24 @@
     unsigned int ret;
 
-    while (done == 0) {
-        do {
-            ret = sys_call(SYSCALL_TTY_READ, (unsigned int) (&byte), 1, 0, 0);
-        } while (ret != 1);
-
-        if ((byte > 0x2F) && (byte < 0x3A)) {
-            /* decimal character */
+    while (done == 0) 
+    {
+        do { ret = sys_call(SYSCALL_TTY_READ, (unsigned int) (&byte), 1, 0, 0); } 
+        while (ret != 1);
+
+        if ((byte > 0x2F) && (byte < 0x3A))  /* decimal character */
+        {
             buf[max] = byte;
             max++;
             giet_tty_putc(byte);
         }
-        else if ((byte == 0x0A) || (byte == 0x0D)) {
-            /* LF or CR character */
+        else if ((byte == 0x0A))   /* LF */
+        {
             done = 1;
         }
-        else if (byte == 0x7F) {
-            /* DEL character */
-            if (max > 0) {
-                max--; /* cancel the character */
+        else if (byte == 0x7F)   /* DEL */
+        {
+            if (max > 0) 
+            {
+                max--;      /* cancel the character */
                 giet_tty_putc(0x08);
                 giet_tty_putc(0x20);
@@ -271,7 +283,8 @@
             }
         }
-        if (max == 32) {
-            /* decimal string overflow */
-            for (i = 0; i < max; i++) {
+        if (max == 32)  /* decimal string overflow */
+        {
+            for (i = 0; i < max; i++) 
+            {
                 /* cancel the string */
                 giet_tty_putc(0x08);
@@ -280,5 +293,5 @@
             }
             giet_tty_putc(0x30);
-            *val = 0; /* return 0 value */
+            *val = 0;      /* return 0 value */
             return 0;
         }
@@ -286,18 +299,20 @@
 
     /* string conversion */
-    for (i = 0; i < max; i++) {
+    for (i = 0; i < max; i++) 
+    {
         dec = dec * 10 + (buf[i] - 0x30);
-        if (dec < save) {
-            overflow = 1;
-        }
+        if (dec < save)  overflow = 1; 
         save = dec;
     }
 
     /* check overflow */
-    if (overflow == 0) {
+    if (overflow == 0) 
+    {
         *val = dec; /* return decimal value */
     }
-    else {
-        for (i = 0; i < max; i++) {
+    else 
+    {
+        for (i = 0; i < max; i++) 
+        {
             /* cancel the string */
             giet_tty_putc(0x08);
@@ -306,5 +321,5 @@
         }
         giet_tty_putc(0x30);
-        *val = 0; /* return 0 value */
+        *val = 0;         /* return 0 value */
     }
     return 0;
@@ -326,5 +341,6 @@
 // - Returns 0 if success, > 0 if error.
 ////////////////////////////////////////////////////////////////////////////////////
-unsigned int giet_tty_printf(char * format, ...) {
+unsigned int giet_tty_printf(char * format, ...) 
+{
     va_list ap;
     va_start(ap, format);
@@ -333,15 +349,16 @@
 printf_text:
 
-    while (*format) {
+    while (*format) 
+    {
         unsigned int i;
         for (i = 0; format[i] && format[i] != '%'; i++);
-        if (i) {
+        if (i) 
+        {
             ret = sys_call(SYSCALL_TTY_WRITE, (unsigned int) format, i, 0, 0);
-            if (ret != i) {
-                return 1; /* return error */
-            }
+            if (ret != i)  return 1; /* return error */ 
             format += i;
         }
-        if (*format == '%') {
+        if (*format == '%') 
+        {
             format++;
             goto printf_arguments;
