Print this page
4378 Clean up %C in *time() functions
438 need documentation for strftime %s flag
*** 18,27 ****
--- 18,29 ----
*
* CDDL HEADER END
*/
/*
+ * Copyright (c) 2014 Gary Mills
+ *
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <stdio.h>
#include <stdlib.h>
*** 71,81 ****
/* too big for formatting */
return;
}
(void) memcpy(&timefield, field, sizeof (timefield));
timefield = BE_32(timefield);
! if (strftime(timestring, sizeof (timestring), "%C",
localtime(&timefield)) == 0) {
/* buffer too small */
return;
}
(void) nvlist_add_string(nv, path, timestring);
--- 73,83 ----
/* too big for formatting */
return;
}
(void) memcpy(&timefield, field, sizeof (timefield));
timefield = BE_32(timefield);
! if (strftime(timestring, sizeof (timestring), "%c",
localtime(&timefield)) == 0) {
/* buffer too small */
return;
}
(void) nvlist_add_string(nv, path, timestring);