shadow/libmisc
Alejandro Colomar 355ad6a9e0 Have a single definition of date_to_str()
PARAMETERS:

According to the C2x charter, I reordered the parameters 'size'
and 'buf' from previously existing date_to_str() definitions.

C2x charter:
> 15. Application Programming Interfaces (APIs) should be
> self-documenting when possible.  In particular, the order of
> parameters in function declarations should be arranged such that
> the size of an array appears before the array.  The purpose is to
> allow Variable-Length Array (VLA) notation to be used.  This not
> only makes the code's purpose clearer to human readers, but also
> makes static analysis easier.  Any new APIs added to the Standard
> should take this into consideration.

I used 'long' for the date parameter, as some uses of the function
need to pass a negative value meaning "never".

FUNCTION BODY:

I didn't check '#ifdef HAVE_STRFTIME', which old definitions did,
since strftime(3) is guaranteed by the C89 standard, and all of
the conversion specifiers that we use are also specified by that
standard, so we don't need any extensions at all.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2021-12-26 18:55:39 +01:00
..
.indent.pro Commit the last version from the PLD CVS repository. 2007-10-07 14:36:51 +00:00
addgrps.c Fix covscan RESOURCE_LEAK 2021-06-24 09:18:35 +02:00
age.c * libmisc/env.c, libmisc/age.c: Added splint annotations. 2009-04-23 17:33:21 +00:00
audit_help.c fix spelling and unify whitespace 2021-08-18 18:06:02 +00:00
basename.c Miscellaneous: 2011-09-18 21:02:43 +00:00
btrfs.c silence compiler warnings 2020-01-12 07:31:26 -06:00
chkname.c chkname.c, pwck.c, useradd.c, usermod.c, newusers.c: Allow names that do not conform to standards 2019-10-04 18:40:41 -05:00
chkname.h Updated copyright dates. 2008-05-25 23:31:10 +00:00
chowndir.c * libmisc/chowndir.c: Add splint annotations. 2011-08-14 14:00:14 +00:00
chowntty.c Fix covscan RESOURCE_LEAK 2021-06-24 09:18:35 +02:00
cleanup_group.c libsubid: don't print error messages on stderr by default 2021-05-15 12:38:55 -05:00
cleanup_user.c libsubid: don't print error messages on stderr by default 2021-05-15 12:38:55 -05:00
cleanup.c * lib/prototypes.h, libmisc/cleanup.c, lib/spawn.c, src/chage.c: 2011-10-18 20:23:33 +00:00
console.c Fix some issues found in Coverity scan. 2018-10-10 12:22:04 +02:00
copydir.c fix spelling and unify whitespace 2021-08-18 18:06:02 +00:00
date_to_str.c Have a single definition of date_to_str() 2021-12-26 18:55:39 +01:00
entry.c Make sure every source files are distributed with a copyright and license. 2008-04-27 00:40:09 +00:00
env.c libsubid: don't print error messages on stderr by default 2021-05-15 12:38:55 -05:00
failure.c Fix covscan BUFFER_SIZE 2021-06-16 09:50:53 +02:00
failure.h spelling: cumulative 2017-10-22 18:33:13 +00:00
find_new_gid.c fix spelling and unify whitespace 2021-08-18 18:06:02 +00:00
find_new_sub_gids.c fix spelling and unify whitespace 2021-08-18 18:06:02 +00:00
find_new_sub_uids.c fix spelling and unify whitespace 2021-08-18 18:06:02 +00:00
find_new_uid.c fix spelling and unify whitespace 2021-08-18 18:06:02 +00:00
getdate.h * libmisc/limits.c: Avoid implicit conversion of integer to 2010-08-22 19:13:53 +00:00
getdate.y spelling: gratuitously 2017-10-22 19:17:02 +00:00
getgr_nam_gid.c * lib/prototypes.h, libmisc/getgr_nam_gid.c: getgr_nam_gid() 2011-08-14 13:16:26 +00:00
getrange.c * libmisc/get_gid.c, libmisc/get_uid.c, libmisc/Makefile.am, 2009-03-08 20:26:56 +00:00
gettime.c libsubid: don't print error messages on stderr by default 2021-05-15 12:38:55 -05:00
hushed.c Handle malformed lines in hushlogins file. 2021-10-29 19:50:38 +02:00
idmapping.c fix spelling and unify whitespace 2021-08-18 18:06:02 +00:00
idmapping.h subids: support nsswitch 2021-04-16 21:02:37 -05:00
isexpired.c * libmisc/isexpired.c: Added parenthesis. 2011-06-16 21:25:36 +00:00
limits.c fix spelling 2021-09-13 15:11:40 +00:00
list.c libmisc: don't free members variable 2021-07-14 12:13:25 +02:00
log.c fix spelling and unify whitespace 2021-08-18 18:06:02 +00:00
loginprompt.c fix spelling and unify whitespace 2021-08-18 18:06:02 +00:00
mail.c * libmisc/mail.c, libmisc/copydir.c: Added missing include of 2009-04-27 20:09:18 +00:00
Makefile.am Have a single definition of date_to_str() 2021-12-26 18:55:39 +01:00
motd.c fix spelling and unify whitespace 2021-08-18 18:06:02 +00:00
myname.c Fix covscan RESOURCE_LEAK 2021-06-24 09:18:35 +02:00
obscure.c Add yescrypt support 2021-02-01 22:11:10 +01:00
pam_pass_non_interactive.c libsubid: don't print error messages on stderr by default 2021-05-15 12:38:55 -05:00
pam_pass.c libsubid: don't print error messages on stderr by default 2021-05-15 12:38:55 -05:00
prefix_flag.c groupdel: fix SIGSEGV when passwd does not exist 2021-11-01 13:54:25 +01:00
pwd_init.c Make sure every source files are distributed with a copyright and license. 2008-04-27 00:40:09 +00:00
pwd2spwd.c Make the sp_lstchg shadow field reproducible (re. #71) 2019-03-31 16:00:01 +01:00
pwdcheck.c libsubid: don't print error messages on stderr by default 2021-05-15 12:38:55 -05:00
remove_tree.c Integrate review comments from Julien Cristau 2010-09-05 15:34:42 +00:00
rlogin.c * lib/exitcodes.h: Define E_SUCCESS as EXIT_SUCCESS. Added FIXMEs. 2009-04-30 21:08:49 +00:00
root_flag.c libsubid: don't print error messages on stderr by default 2021-05-15 12:38:55 -05:00
salt.c libmisc: fix default value in SHA_get_salt_rounds() 2021-08-14 13:43:26 -04:00
setugid.c Updated copyrights. 2010-08-22 13:04:54 +00:00
setupenv.c libsubid: don't print error messages on stderr by default 2021-05-15 12:38:55 -05:00
shell.c * libmisc/limits.c: Avoid implicit conversion of integer to 2010-08-22 19:13:53 +00:00
strtoday.c spelling: cumulative 2017-10-22 18:33:13 +00:00
sub.c Fix typo in comment. 2013-08-04 15:56:32 +02:00
sulog.c Updated copyrights. 2010-08-22 13:04:54 +00:00
ttytype.c * libmisc/limits.c: Avoid implicit conversion of integer to 2010-08-22 19:13:53 +00:00
tz.c Updated copyrights. 2010-08-22 13:04:54 +00:00
ulimit.c * libmisc/limits.c: Add brackets and parenthesis. 2008-06-15 21:59:41 +00:00
user_busy.c Fix covscan RESOURCE_LEAK 2021-06-24 09:18:35 +02:00
utmp.c Fix covscan BUFFER_SIZE 2021-06-16 09:50:53 +02:00
valid.c crypt() in glibc/eglibc 2.17 now fails if passed 2013-07-28 18:41:11 +02:00
xgetgrgid.c * libmisc/xgetXXbyYY.c, libmisc/xgetpwnam.c, libmisc/xgetgrnam.c, 2009-06-11 21:33:00 +00:00
xgetgrnam.c * libmisc/xgetXXbyYY.c, libmisc/xgetpwnam.c, libmisc/xgetgrnam.c, 2009-06-11 21:33:00 +00:00
xgetpwnam.c * libmisc/xgetXXbyYY.c, libmisc/xgetpwnam.c, libmisc/xgetgrnam.c, 2009-06-11 21:33:00 +00:00
xgetpwuid.c * libmisc/xgetXXbyYY.c, libmisc/xgetpwnam.c, libmisc/xgetgrnam.c, 2009-06-11 21:33:00 +00:00
xgetspnam.c * libmisc/xgetXXbyYY.c, libmisc/xgetpwnam.c, libmisc/xgetgrnam.c, 2009-06-11 21:33:00 +00:00
xgetXXbyYY.c libsubid: don't print error messages on stderr by default 2021-05-15 12:38:55 -05:00
xmalloc.c libsubid: don't print error messages on stderr by default 2021-05-15 12:38:55 -05:00
yesno.c * libmisc/yesno.c: Ignore the return value of puts. 2009-04-23 11:14:56 +00:00