changeset 1249:ebeb6294ee46

Added a couple extra sanity checks to dlib
author Jorge Arellano Cid <jcid@dillo.org>
date Wed, 29 Jul 2009 12:54:26 -0400
parents 0ddb9d28e378
children c478e5a7bed6
files dlib/dlib.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dlib/dlib.c	Sun Jul 26 03:12:36 2009 +0000
+++ b/dlib/dlib.c	Wed Jul 29 12:54:26 2009 -0400
@@ -150,8 +150,7 @@
 {
    char *str, *p;
 
-   if (!(str = *orig))
-      return NULL;
+   dReturn_val_if_fail (orig && (str = *orig) && delim, NULL);
 
    p = strpbrk(str, delim);
    if (p) {
@@ -170,6 +169,8 @@
 {
    int i, j;
 
+   dReturn_val_if_fail (haystack && needle, NULL);
+
    for (i = 0, j = 0; haystack[i] && needle[j]; ++i)
       if (tolower(haystack[i]) == tolower(needle[j])) {
          ++j;