summaryrefslogtreecommitdiff
path: root/iconv/gconv_conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconv/gconv_conf.c')
-rw-r--r--iconv/gconv_conf.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c
index 8a72c7aac9..fb03372def 100644
--- a/iconv/gconv_conf.c
+++ b/iconv/gconv_conf.c
@@ -322,11 +322,8 @@ read_conf_file (const char *filename, const char *directory, size_t dir_len,
if (endp != NULL)
*endp = '\0';
else
- {
- endp = strchr (rp, '\n');
- if (endp != NULL)
- *endp = '\0';
- }
+ if (rp[n - 1] == '\n')
+ rp[n - 1] = '\0';
while (isspace (*rp))
++rp;