From: Alejandro Colomar Date: Wed, 23 Jul 2025 17:59:02 +0000 (+0200) Subject: lib/io/syslog.h: SYSLOG_C(): Use a single local variable X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=12675134848d371e40eb0a4fc49fafead2941e4c;p=thirdparty%2Fshadow.git lib/io/syslog.h: SYSLOG_C(): Use a single local variable There's no need for two variables, and this avoids one assignment. Signed-off-by: Alejandro Colomar --- diff --git a/lib/io/syslog.h b/lib/io/syslog.h index bd58e088f..db05c31b6 100644 --- a/lib/io/syslog.h +++ b/lib/io/syslog.h @@ -49,21 +49,19 @@ #define SYSLOG_C(...) do \ { \ char *l_; \ - char *saved_locale; \ \ l_ = setlocale(LC_ALL, NULL); \ - saved_locale = NULL; \ \ if (NULL != l_) \ - saved_locale = strdup(l_); \ + l_ = strdup(l_); \ \ - if (NULL != saved_locale) \ + if (NULL != l_) \ setlocale(LC_ALL, "C"); \ \ syslog(__VA_ARGS__); \ - if (NULL != saved_locale) { \ - setlocale(LC_ALL, saved_locale); \ - free(saved_locale); \ + if (NULL != l_) { \ + setlocale(LC_ALL, l_); \ + free(l_); \ } \ } while (0)