Changeset 350514c in mainline for libc/generic/io.c


Ignore:
Timestamp:
2006-01-15T17:37:14Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
12c6f2d
Parents:
ecfd7e5
Message:

some fancy stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libc/generic/io.c

    recfd7e5 r350514c  
    3131#include <stdio.h>
    3232
     33static char nl = '\n';
     34
    3335int puts(const char * str)
    3436{
     
    3638       
    3739        for (count = 0; str[count] != 0; count++);
    38         if (write(1, (void * ) str, count) == count)
    39                 return 0;
    40         else
    41                 return EOF;
     40        if (write(1, (void * ) str, count) == count) {
     41                if (write(1, &nl, 1) == 1)
     42                        return 0;
     43        }
     44       
     45        return EOF;
    4246}
    4347
Note: See TracChangeset for help on using the changeset viewer.