Commit 1d31a280 1d31a280d7be7590c25f1ca7a74460097b3a7ebd by Sergey Poznyakoff

(_memory_truncate): Bugfix.

1 parent 86e0a310
...@@ -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;
......