This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

strftime


The fileutils-4.0 version of strftime differs from the current libc one:

@@ -1041,6 +1043,7 @@ my_strftime (s, maxsize, format, tp ut_a
 	  add (1, *p = '\t');
 	  break;
 
+	case 'f':
 	case 'u':		/* POSIX.2 extension.  */
 	  DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1);
 
@@ -1235,7 +1238,7 @@ my_strftime (s, maxsize, format, tp ut_a
 	}
     }
 
-  if (p && maxsize != 0)
+  if (p && i < maxsize)
     *p = '\0';
   return i;
 }


This slight difference is enough to make fileutils use its own strftime
instead of libc's (it tests for %f).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]