summaryrefslogtreecommitdiff
path: root/libio/iogetline.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /libio/iogetline.c
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'libio/iogetline.c')
-rw-r--r--libio/iogetline.c56
1 files changed, 27 insertions, 29 deletions
diff --git a/libio/iogetline.c b/libio/iogetline.c
index 022a444f77..eca38cf773 100644
--- a/libio/iogetline.c
+++ b/libio/iogetline.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993,1997,1998,2000,2001,2002,2005
- Free Software Foundation, Inc.
+/* Copyright (C) 1993,1997,1998,2000,2001,2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -74,8 +73,7 @@ _IO_getline_info (fp, buf, n, delim, extract_delim, eof)
int c = __uflow (fp);
if (c == EOF)
{
- if (eof)
- *eof = c;
+ if (eof) *eof = c;
break;
}
if (c == delim)
@@ -91,31 +89,31 @@ _IO_getline_info (fp, buf, n, delim, extract_delim, eof)
*ptr++ = c;
n--;
}
- else
- {
- char *t;
- if ((_IO_size_t) len >= n)
- len = n;
- t = (char *) memchr ((void *) fp->_IO_read_ptr, delim, len);
- if (t != NULL)
- {
- _IO_size_t old_len = ptr-buf;
- len = t - fp->_IO_read_ptr;
- if (extract_delim >= 0)
- {
- ++t;
- if (extract_delim > 0)
- ++len;
- }
- memcpy ((void *) ptr, (void *) fp->_IO_read_ptr, len);
- fp->_IO_read_ptr = t;
- return old_len + len;
- }
- memcpy ((void *) ptr, (void *) fp->_IO_read_ptr, len);
- fp->_IO_read_ptr += len;
- ptr += len;
- n -= len;
- }
+ else
+ {
+ char *t;
+ if ((_IO_size_t) len >= n)
+ len = n;
+ t = (char *) memchr ((void *) fp->_IO_read_ptr, delim, len);
+ if (t != NULL)
+ {
+ _IO_size_t old_len = ptr-buf;
+ len = t - fp->_IO_read_ptr;
+ if (extract_delim >= 0)
+ {
+ ++t;
+ if (extract_delim > 0)
+ ++len;
+ }
+ memcpy ((void *) ptr, (void *) fp->_IO_read_ptr, len);
+ fp->_IO_read_ptr = t;
+ return old_len + len;
+ }
+ memcpy ((void *) ptr, (void *) fp->_IO_read_ptr, len);
+ fp->_IO_read_ptr += len;
+ ptr += len;
+ n -= len;
+ }
}
return ptr - buf;
}