Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31394
b: refs/heads/master
c: c2b7a4b
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Jun 30, 2006
1 parent 8fc4398 commit 407fa52
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dd673bca474a199fb8d1b6a311832592977ecb5f
refs/heads/master: c2b7a4bb30008dc256d63802e02b6fb950958443
14 changes: 12 additions & 2 deletions trunk/arch/um/os-Linux/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void __init find_tempdir(void)
*/
static int next(int fd, char *buf, int size, char c)
{
int n;
int n, len;
char *ptr;

while((ptr = strchr(buf, c)) == NULL){
Expand All @@ -69,7 +69,17 @@ static int next(int fd, char *buf, int size, char c)
}

ptr++;
memmove(buf, ptr, strlen(ptr) + 1);
len = strlen(ptr);
memmove(buf, ptr, len + 1);

/* Refill the buffer so that if there's a partial string that we care
* about, it will be completed, and we can recognize it.
*/
n = read(fd, &buf[len], size - len - 1);
if(n < 0)
return -errno;

buf[len + n] = '\0';
return 1;
}

Expand Down

0 comments on commit 407fa52

Please sign in to comment.