summaryrefslogtreecommitdiff
path: root/libtreefs/s-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtreefs/s-file.c')
-rw-r--r--libtreefs/s-file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libtreefs/s-file.c b/libtreefs/s-file.c
index 73c32d7f..c24d645e 100644
--- a/libtreefs/s-file.c
+++ b/libtreefs/s-file.c
@@ -220,6 +220,8 @@ treefs_S_file_set_size (struct treefs_protid *cred, off_t size)
{
if (!cred)
return EOPNOTSUPP;
+ else if (size < 0)
+ return EINVAL;
return treefs_s_file_set_size (cred, size);
}