Relocate ijb_isdigit()'s definition to project.h
[privoxy.git] / miscutil.c
index 34e8e4f..de423aa 100644 (file)
@@ -1,4 +1,4 @@
-const char miscutil_rcs[] = "$Id: miscutil.c,v 1.67 2011/05/22 10:30:55 fabiankeil Exp $";
+const char miscutil_rcs[] = "$Id: miscutil.c,v 1.70 2012/03/04 11:48:34 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/miscutil.c,v $
@@ -72,7 +72,6 @@ const char miscutil_h_rcs[] = MISCUTIL_H_VERSION;
  * Function    :  zalloc
  *
  * Description :  Malloc some memory and set it to '\0'.
- *                The way calloc() ought to be -acjc
  *
  * Parameters  :
  *          1  :  size = Size of memory chunk to return.
@@ -136,13 +135,12 @@ void write_pid_file(void)
  * Function    :  hash_string
  *
  * Description :  Take a string and compute a (hopefuly) unique numeric
- *                integer value.  This has several uses, but being able
- *                to "switch" a string the one of my favorites.
+ *                integer value. This is useful to "switch" a string.
  *
  * Parameters  :
  *          1  :  s : string to be hashed.
  *
- * Returns     :  an unsigned long variable with the hashed value.
+ * Returns     :  The string's hash
  *
  *********************************************************************/
 unsigned int hash_string( const char* s )
@@ -472,13 +470,10 @@ char *bindup(const char *string, size_t len)
 {
    char *duplicate;
 
-   if (NULL == (duplicate = (char *)malloc(len)))
+   duplicate = (char *)malloc(len);
+   if (NULL != duplicate)
    {
-      return NULL;
-   }
-   else
-   {
-     memcpy(duplicate, string, len);
+      memcpy(duplicate, string, len);
    }
 
    return duplicate;