~ubuntu-branches/ubuntu/gutsy/avr-libc/gutsy

« back to all changes in this revision

Viewing changes to libc/stdio/gets.c

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2006-05-01 12:03:39 UTC
  • mto: (3.1.1 edgy)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060501120339-q93dxulpunby36dj
Tags: upstream-1.4.4
ImportĀ upstreamĀ versionĀ 1.4.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
  POSSIBILITY OF SUCH DAMAGE.
28
28
*/
29
29
 
30
 
/* $Id: gets.c,v 1.2 2002/12/30 23:35:04 joerg_wunsch Exp $ */
 
30
/* $Id: gets.c,v 1.3 2005/09/06 18:49:15 joerg_wunsch Exp $ */
31
31
 
32
32
#include <stdio.h>
33
33
 
43
43
                return NULL;
44
44
 
45
45
        for (c = 0, cp = str; c != '\n'; cp++) {
46
 
                if ((c = getchar()) == EOF) {
47
 
                        stdin->flags |= __SERR;
 
46
                if ((c = getchar()) == EOF)
48
47
                        return NULL;
49
 
                }
50
48
                *cp = (char)c;
51
49
        }
52
50
        *--cp = '\0';