65 |
|
|
66 |
if (start + amount > size) |
if (start + amount > size) |
67 |
amount = size - start; |
amount = size - start; |
68 |
|
if (amount > size) |
69 |
|
amount = size; |
70 |
|
|
71 |
if (start >= size) |
if (start >= size) |
72 |
{ |
{ |
76 |
else if (amount < size || start > 0) |
else if (amount < size || start > 0) |
77 |
{ |
{ |
78 |
char *whole_link = alloca (size); |
char *whole_link = alloca (size); |
79 |
err = netfs_attempt_readlink (user->user, node, *data); |
err = netfs_attempt_readlink (user->user, node, whole_link); |
80 |
if (! err) |
if (! err) |
81 |
{ |
{ |
82 |
memcpy (*data, whole_link + start, amount); |
memcpy (*data, whole_link + start, amount); |
84 |
} |
} |
85 |
} |
} |
86 |
else |
else |
87 |
err = netfs_attempt_readlink (user->user, node, *data); |
{ |
88 |
|
err = netfs_attempt_readlink (user->user, node, *data); |
89 |
|
*datalen = amount; |
90 |
|
} |
91 |
} |
} |
92 |
else |
else |
93 |
/* Read from a normal file. */ |
/* Read from a normal file. */ |