From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: [PATCH v2] shadow: Implement putspent
Date: Tue, 5 Nov 2013 18:31:48 -0500 [thread overview]
Message-ID: <20131105233148.GJ24286@brightrain.aerifal.cx> (raw)
In-Reply-To: <1383690600-24170-1-git-send-email-mforney@mforney.org>
On Tue, Nov 05, 2013 at 02:30:00PM -0800, Michael Forney wrote:
> ---
> Thanks Rich,
>
> I didn't know about negative and zero precision specifiers. This turned out
> much cleaner.
>
> I've also changed the fields to use %ld because they are longs, and changed the
> last field to %lu because it is unsigned (though unused).
Thanks.
> src/passwd/fgetspent.c | 5 -----
> src/passwd/putspent.c | 13 +++++++++++++
> 2 files changed, 13 insertions(+), 5 deletions(-)
> create mode 100644 src/passwd/putspent.c
>
> diff --git a/src/passwd/fgetspent.c b/src/passwd/fgetspent.c
> index a9a3c97..3dda784 100644
> --- a/src/passwd/fgetspent.c
> +++ b/src/passwd/fgetspent.c
> @@ -4,8 +4,3 @@ struct spwd *fgetspent(FILE *f)
> {
> return 0;
> }
> -
> -int putspent(const struct spwd *sp, FILE *f)
> -{
> - return -1;
> -}
> diff --git a/src/passwd/putspent.c b/src/passwd/putspent.c
> new file mode 100644
> index 0000000..fbf4278
> --- /dev/null
> +++ b/src/passwd/putspent.c
> @@ -0,0 +1,13 @@
> +#include <shadow.h>
> +#include <stdio.h>
> +
> +#define NUM(n) (n == -1 ? 0 : -1), (n == -1 ? 0 : n)
> +#define STR(s) (s ? s : "")
While it doesn't really matter in this file, in general, macro
arguments should be properly parenthesized, as in:
+#define NUM(n) ((n) == -1 ? 0 : -1), ((n) == -1 ? 0 : (n))
+#define STR(s) ((s) ? (s) : "")
Otherwise this patch is probably ok. If nobody else has comments on it
I can commit it soon. I'll look at the others again too but in general
I didn't see anything objectionable.
Rich
next prev parent reply other threads:[~2013-11-05 23:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-05 7:47 [PATCH] " Michael Forney
2013-11-05 19:24 ` Rich Felker
2013-11-05 22:30 ` [PATCH v2] " Michael Forney
2013-11-05 23:31 ` Rich Felker [this message]
2013-11-06 13:20 ` Jens Gustedt
2013-11-06 16:36 ` Rich Felker
2013-11-07 22:35 ` Jens Gustedt
2013-11-08 0:37 ` Szabolcs Nagy
2013-11-24 6:10 ` [PATCH v3] " Michael Forney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131105233148.GJ24286@brightrain.aerifal.cx \
--to=dalias@aerifal.cx \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).