From 2ad415080cf54a0edde466fc954b7e207779b95e Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 10 Mar 2004 07:45:16 +0000 Subject: [PATCH] Fix brown-bag bug introduced in last check-in. --- src/ChangeLog | 5 +++++ src/format.c | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5e7f0c1a..8450557f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +Tue Mar 9 23:44:40 2004 Ben Pfaff + + * format.c: (parse_format_specifier_name) Fix brown-bag bug + introduced in last check-in. + Tue Mar 9 23:10:41 2004 Ben Pfaff * format.c: (global array translate_fmt[]) Removed. diff --git a/src/format.c b/src/format.c index 37e691a4..4ff96241 100644 --- a/src/format.c +++ b/src/format.c @@ -58,7 +58,7 @@ parse_format_specifier_name (const char **cp, int allow_xt) /* Find format. */ for (idx = 0; idx < FMT_NUMBER_OF_FORMATS; idx++) if (strlen (formats[idx].name) == ep - sp - && memcmp (formats[idx].name, sp, ep - sp)) + && !memcmp (formats[idx].name, sp, ep - sp)) break; /* Check format. */ @@ -84,8 +84,13 @@ parse_format_specifier_name (const char **cp, int allow_xt) idx = -1; } - if (cp != NULL) - *cp = ep; + if (cp != NULL) + { + if (idx != -1) + *cp = ep; + else + *cp = NULL; + } return idx; } -- 2.30.2