diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-02-19 00:10:57 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-02-19 11:18:42 +1100 |
commit | 011c8ffbb0275281a0cf330054cf21be10c43e37 (patch) | |
tree | 64e11ed6b6ccec165f01efb11c6c5467abdc8775 /utf8.c | |
parent | 0c4430a19b73058a569573492f55e4c9eeaae67b (diff) | |
download | openssh-git-011c8ffbb0275281a0cf330054cf21be10c43e37.tar.gz |
upstream commit
Add a common nl_langinfo(CODESET) alias for US-ASCII
"ANSI_X3.4-1968" that is used by Linux. Fixes mprintf output truncation for
non-UTF-8 locales on Linux spotted by dtucker@; ok deraadt@ schwarze@
Upstream-ID: c6808956ebffd64066f9075d839f74ff0dd60719
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: utf8.c,v 1.4 2017/02/02 10:54:25 jsg Exp $ */ +/* $OpenBSD: utf8.c,v 1.5 2017/02/19 00:10:57 djm Exp $ */ /* * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> * @@ -60,7 +60,8 @@ dangerous_locale(void) { char *loc; loc = nl_langinfo(CODESET); - return strcmp(loc, "US-ASCII") && strcmp(loc, "UTF-8"); + return strcmp(loc, "US-ASCII") != 0 && strcmp(loc, "UTF-8") != 0 && + strcmp(loc, "ANSI_X3.4-1968") != 0; } static int |