Source-Changes-HG archive

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

[src/trunk]: src/sys/modules/example Check to see if we were passed a NULL pr...



details:   https://anonhg.NetBSD.org/src/rev/38b7586c4612
branches:  trunk
changeset: 748316:38b7586c4612
user:      jnemeth <jnemeth%NetBSD.org@localhost>
date:      Tue Oct 20 05:33:30 2009 +0000

description:
Check to see if we were passed a NULL proplist dictionary.

diffstat:

 sys/modules/example/example.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r 2f1dba1c96e9 -r 38b7586c4612 sys/modules/example/example.c
--- a/sys/modules/example/example.c     Tue Oct 20 04:44:33 2009 +0000
+++ b/sys/modules/example/example.c     Tue Oct 20 05:33:30 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: example.c,v 1.4 2009/01/14 00:53:44 haad Exp $ */
+/*     $NetBSD: example.c,v 1.5 2009/10/20 05:33:30 jnemeth Exp $      */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: example.c,v 1.4 2009/01/14 00:53:44 haad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: example.c,v 1.5 2009/10/20 05:33:30 jnemeth Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -46,7 +46,11 @@
 {
        prop_string_t str;
 
-       str = prop_dictionary_get(props, "msg");
+       if (props != NULL) {
+               str = prop_dictionary_get(props, "msg");
+       } else {
+               str = NULL;
+       }
        if (str == NULL)
                printf("The 'msg' property was not given.\n");
        else if (prop_object_type(str) != PROP_TYPE_STRING)



Home | Main Index | Thread Index | Old Index