aboutsummaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
Diffstat (limited to 'time')
-rw-r--r--time/asctime.c2
-rw-r--r--time/localtime.c2
-rw-r--r--time/strftime.c14
3 files changed, 6 insertions, 12 deletions
diff --git a/time/asctime.c b/time/asctime.c
index bb20a3a..25bc9de 100644
--- a/time/asctime.c
+++ b/time/asctime.c
@@ -39,7 +39,7 @@ __asctime_r (const struct tm *tp, char *buf)
{
if (tp == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return NULL;
}
diff --git a/time/localtime.c b/time/localtime.c
index 2a78030..ce243e6 100644
--- a/time/localtime.c
+++ b/time/localtime.c
@@ -50,7 +50,7 @@ __localtime_r (timer, tp)
if (timer == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return NULL;
}
diff --git a/time/strftime.c b/time/strftime.c
index 7837373..9d23cf7 100644
--- a/time/strftime.c
+++ b/time/strftime.c
@@ -529,17 +529,11 @@ strftime (s, maxsize, format, tp)
#ifdef _NL_CURRENT
if (modifier == 'O' && 0 <= number_value)
{
- /* ALT_DIGITS is the first entry in an array with
- alternative digit symbols. We have to find string
- number NUMBER_VALUE, but must not look beyond
- END_ALT_DIGITS. */
- int run = number_value;
- const char *cp = alt_digits;
+ /* Get the locale specific alternate representation of
+ the number NUMBER_VALUE. If none exist NULL is returned. */
+ const char *cp = _nl_get_alt_digit (number_value);
- while (run-- > 0 && cp < end_alt_digits)
- cp = strchr (cp, '\0') + 1;
-
- if (cp < end_alt_digits)
+ if (cp != NULL)
{
size_t digitlen = strlen (cp);
if (digitlen != 0)