about summary refs log tree commit diff
path: root/time/strftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'time/strftime.c')
-rw-r--r--time/strftime.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/time/strftime.c b/time/strftime.c
index 7837373aed..9d23cf7183 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)