Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
SDB - Self-describing Bus
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
SDB - Self-describing Bus
Commits
613f134e
Commit
613f134e
authored
May 22, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sdbfs/userspace/lib: bugfix in access.c
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
aa05e0dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
access.c
sdbfs/lib/access.c
+4
-2
No files found.
sdbfs/lib/access.c
View file @
613f134e
...
...
@@ -21,7 +21,7 @@ int sdbfs_fstat(struct sdbfs *fs, struct sdb_device *record_return)
int
sdbfs_fread
(
struct
sdbfs
*
fs
,
int
offset
,
void
*
buf
,
int
count
)
{
int
ret
=
count
;
int
ret
;
if
(
!
fs
->
currentp
)
return
-
ENOENT
;
...
...
@@ -29,6 +29,7 @@ int sdbfs_fread(struct sdbfs *fs, int offset, void *buf, int count)
offset
=
fs
->
read_offset
;
if
(
offset
+
count
>
fs
->
f_len
)
count
=
fs
->
f_len
-
offset
;
ret
=
count
;
if
(
fs
->
data
)
memcpy
(
buf
,
fs
->
data
+
fs
->
f_offset
+
offset
,
count
);
else
...
...
@@ -40,7 +41,7 @@ int sdbfs_fread(struct sdbfs *fs, int offset, void *buf, int count)
int
sdbfs_fwrite
(
struct
sdbfs
*
fs
,
int
offset
,
void
*
buf
,
int
count
)
{
int
ret
=
count
;
int
ret
;
if
(
!
fs
->
currentp
)
return
-
ENOENT
;
...
...
@@ -48,6 +49,7 @@ int sdbfs_fwrite(struct sdbfs *fs, int offset, void *buf, int count)
offset
=
fs
->
read_offset
;
if
(
offset
+
count
>
fs
->
f_len
)
count
=
fs
->
f_len
-
offset
;
ret
=
count
;
if
(
fs
->
data
)
memcpy
(
buf
,
fs
->
data
+
fs
->
f_offset
+
offset
,
count
);
else
...
...
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