Source-Changes-HG archive

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

[src/trunk]: src/common/lib/libprop proplib: Fix mistake in previous -- use s...



details:   https://anonhg.NetBSD.org/src/rev/f15b9db04c4a
branches:  trunk
changeset: 368785:f15b9db04c4a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Aug 04 09:02:29 2022 +0000

description:
proplib: Fix mistake in previous -- use strncmp for prefix matching.

diffstat:

 common/lib/libprop/prop_object.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 03dbca07ac13 -r f15b9db04c4a common/lib/libprop/prop_object.c
--- a/common/lib/libprop/prop_object.c  Wed Aug 03 21:20:21 2022 +0000
+++ b/common/lib/libprop/prop_object.c  Thu Aug 04 09:02:29 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: prop_object.c,v 1.33 2022/08/03 21:20:21 riastradh Exp $       */
+/*     $NetBSD: prop_object.c,v 1.34 2022/08/04 09:02:29 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -735,7 +735,7 @@
                if (_PROP_EOF(*xml) || *xml != '<')
                        goto bad;
 
-#define        MATCH(str)      (strcmp(&xml[1], str) == 0)
+#define        MATCH(str)      (strncmp(&xml[1], str, strlen(str)) == 0)
 
                /*
                 * Skip over the XML preamble that Apple XML property



Home | Main Index | Thread Index | Old Index