OSDN Git Service
(root)
/
uclinux-h8
/
uClibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f24155c
)
Fix nasty behavior difference from glibc -- also fixes getline()
author
Eric Andersen
<andersen@codepoet.org>
Sun, 30 Sep 2001 04:55:22 +0000
(
04:55
-0000)
committer
Eric Andersen
<andersen@codepoet.org>
Sun, 30 Sep 2001 04:55:22 +0000
(
04:55
-0000)
-Erik
libc/stdio/getdelim.c
patch
|
blob
|
history
diff --git
a/libc/stdio/getdelim.c
b/libc/stdio/getdelim.c
index
65d5738
..
7cc1f8e
100644
(file)
--- a/
libc/stdio/getdelim.c
+++ b/
libc/stdio/getdelim.c
@@
-41,13
+41,12
@@
ssize_t getdelim(char **linebuf, size_t *linebufsz, int delimiter, FILE *file)
int ch;
int idx = 0;
- if ((file == NULL || linebuf==NULL || *linebuf == NULL || *linebufsz == 0)
- && !(*linebuf == NULL && *linebufsz ==0 )) {
+ if (file == NULL || linebuf==NULL || linebufsz == NULL) {
__set_errno(EINVAL);
return -1;
}
- if (*linebuf == NULL
&& *linebufsz == 0)
{
+ if (*linebuf == NULL
|| *linebufsz < 2)
{
*linebuf = malloc(GROWBY);
if (!*linebuf) {
__set_errno(ENOMEM);