(_memory_truncate): Bugfix.
Showing
1 changed file
with
2 additions
and
2 deletions
... | @@ -129,9 +129,9 @@ _memory_truncate (stream_t stream, off_t len) | ... | @@ -129,9 +129,9 @@ _memory_truncate (stream_t stream, off_t len) |
129 | free (mfs->ptr); | 129 | free (mfs->ptr); |
130 | mfs->ptr = NULL; | 130 | mfs->ptr = NULL; |
131 | } | 131 | } |
132 | else | 132 | else if (len != mfs->size) |
133 | { | 133 | { |
134 | char *tmp = realloc (mfs, len); | 134 | char *tmp = realloc (mfs->ptr, len); |
135 | if (tmp == NULL) | 135 | if (tmp == NULL) |
136 | return ENOMEM; | 136 | return ENOMEM; |
137 | mfs->ptr = tmp; | 137 | mfs->ptr = tmp; | ... | ... |
-
Please register or sign in to post a comment