summaryrefslogtreecommitdiff
path: root/libgfortran/intrinsics/cshift0.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/intrinsics/cshift0.c')
-rw-r--r--libgfortran/intrinsics/cshift0.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libgfortran/intrinsics/cshift0.c b/libgfortran/intrinsics/cshift0.c
index 00a50d5db7c..026dd1adc0d 100644
--- a/libgfortran/intrinsics/cshift0.c
+++ b/libgfortran/intrinsics/cshift0.c
@@ -79,10 +79,8 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array,
GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
}
- if (arraysize > 0)
- ret->data = internal_malloc_size (size * arraysize);
- else
- ret->data = internal_malloc_size (1);
+ /* internal_malloc_size allocates a single byte for zero size. */
+ ret->data = internal_malloc_size (size * arraysize);
}
else if (unlikely (compile_options.bounds_check))
{