Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
0bc0ec90
Commit
0bc0ec90
authored
Mar 13, 2013
by
Takashi Iwai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA: info: Small refactoring and a sanity check in snd_info_get_line()
Signed-off-by:
Takashi Iwai
<
tiwai@suse.de
>
parent
0d861ac2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
sound/core/info.c
sound/core/info.c
+8
-13
No files found.
sound/core/info.c
View file @
0bc0ec90
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment