Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/gen Correct oversight of wrong format string with f...



details:   https://anonhg.NetBSD.org/src/rev/5175d2955472
branches:  trunk
changeset: 828274:5175d2955472
user:      rin <rin%NetBSD.org@localhost>
date:      Wed Dec 06 11:33:34 2017 +0000

description:
Correct oversight of wrong format string with fewer number of arguments than
default format string has.

diffstat:

 lib/libc/gen/fmtcheck.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 21f4a658f42d -r 5175d2955472 lib/libc/gen/fmtcheck.c
--- a/lib/libc/gen/fmtcheck.c   Wed Dec 06 10:37:08 2017 +0000
+++ b/lib/libc/gen/fmtcheck.c   Wed Dec 06 11:33:34 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fmtcheck.c,v 1.10 2016/01/20 15:43:05 christos Exp $   */
+/*     $NetBSD: fmtcheck.c,v 1.11 2017/12/06 11:33:34 rin Exp $        */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fmtcheck.c,v 1.10 2016/01/20 15:43:05 christos Exp $");
+__RCSID("$NetBSD: fmtcheck.c,v 1.11 2017/12/06 11:33:34 rin Exp $");
 #endif
 
 #include "namespace.h"
@@ -257,5 +257,8 @@
                if (f1t != f2t)
                        return f2;
        }
-       return f1;
+       if (get_next_format(&f2p, f2t) != FMTCHECK_DONE)
+               return f2;
+       else
+               return f1;
 }



Home | Main Index | Thread Index | Old Index