From 07c9232121c8d6cb1e473bd7b623792253375d93 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 29 Oct 2019 19:41:25 +0100 Subject: Added '+' flag and delt with some special cases --- extract.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'extract.c') diff --git a/extract.c b/extract.c index 2f64b51..11bff1d 100644 --- a/extract.c +++ b/extract.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/29 00:10:36 by cacharle #+# #+# */ -/* Updated: 2019/10/29 00:11:02 by cacharle ### ########.fr */ +/* Updated: 2019/10/29 18:17:38 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -23,6 +23,8 @@ char *extract_standalone_flags(t_pformat *pformat, char *fmt) pformat->flags |= FLAG_ZERO_PADDING; if (*fmt == '-') pformat->flags |= FLAG_LEFT_ADJUSTED; + if (*fmt == '+') + pformat->flags |= FLAG_SIGNED; fmt++; } return (fmt); @@ -51,6 +53,7 @@ char *extract_precision(t_pformat *pformat, char *fmt) { if (*fmt == 0 || *fmt != '.') return (fmt); + pformat->flags &= ~FLAG_ZERO_PADDING; fmt++; if (*fmt == '*') { -- cgit