aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/write.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/io/write.c')
-rw-r--r--libgfortran/io/write.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index 54312bf..b36c5be 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -177,7 +177,9 @@ write_utf8_char4 (st_parameter_dt *dtp, gfc_char4_t *source,
break;
}
- /* Now process the remaining characters, one at a time. */
+ /* Now process the remaining characters, one at a time. We need to
+ adjust the src_len if the user has specified a field width. */
+ src_len = w_len > 0 ? w_len : src_len;
for (j = k; j < src_len; j++)
{
c = source[j];