Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 371707
b: refs/heads/master
c: 0bc0ec9
h: refs/heads/master
i:
  371705: 3d743a8
  371703: 61a1ca6
v: v3
  • Loading branch information
Takashi Iwai committed Mar 13, 2013
1 parent 6652d56 commit 0e0ba61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 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: 0d861ac23812428deae17de2038234b79818b964
refs/heads/master: 0bc0ec903c45163f1263d9936f8a218fe9d3a29e
21 changes: 8 additions & 13 deletions trunk/sound/core/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,26 +700,21 @@ int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len)
{
int c = -1;

if (snd_BUG_ON(!buffer || !buffer->buffer))
return 1;
if (len <= 0 || buffer->stop || buffer->error)
return 1;
while (--len > 0) {
while (!buffer->stop) {
c = buffer->buffer[buffer->curr++];
if (c == '\n') {
if (buffer->curr >= buffer->size)
buffer->stop = 1;
break;
}
*line++ = c;
if (buffer->curr >= buffer->size) {
if (buffer->curr >= buffer->size)
buffer->stop = 1;
if (c == '\n')
break;
if (len) {
len--;
*line++ = c;
}
}
while (c != '\n' && !buffer->stop) {
c = buffer->buffer[buffer->curr++];
if (buffer->curr >= buffer->size)
buffer->stop = 1;
}
*line = '\0';
return 0;
}
Expand Down

0 comments on commit 0e0ba61

Please sign in to comment.