[MPlayer-cvslog] r34716 - in trunk/gui/util: string.c string.h

ib subversion at mplayerhq.hu
Mon Feb 13 17:10:39 CET 2012


Author: ib
Date: Mon Feb 13 17:10:39 2012
New Revision: 34716

Log:
Add doxgen comment to gstrncmp().

Additionally, use correct data type for n.

Modified:
   trunk/gui/util/string.c
   trunk/gui/util/string.h

Modified: trunk/gui/util/string.c
==============================================================================
--- trunk/gui/util/string.c	Mon Feb 13 17:01:55 2012	(r34715)
+++ trunk/gui/util/string.c	Mon Feb 13 17:10:39 2012	(r34716)
@@ -173,7 +173,16 @@ int gstrcasecmp(const char *a, const cha
     return strcasecmp(a, b);
 }
 
-int gstrncmp(const char *a, const char *b, int n)
+/**
+ * @brief A strncmp() that can handle NULL pointers.
+ *
+ * @param a string to be compared
+ * @param b string which is compared
+ * @param n number of characters compared at the most
+ *
+ * @return return value of strncmp() or -1, if a or b are NULL
+ */
+int gstrncmp(const char *a, const char *b, size_t n)
 {
     if (!a && !b)
         return 0;

Modified: trunk/gui/util/string.h
==============================================================================
--- trunk/gui/util/string.h	Mon Feb 13 17:01:55 2012	(r34715)
+++ trunk/gui/util/string.h	Mon Feb 13 17:10:39 2012	(r34716)
@@ -27,7 +27,7 @@ int gstrcasecmp(const char *a, const cha
 char *gstrchr(const char *str, int c);
 int gstrcmp(const char *a, const char *b);
 char *gstrdup(const char *str);
-int gstrncmp(const char *a, const char *b, int n);
+int gstrncmp(const char *a, const char *b, size_t n);
 void setddup(char **old, const char *dir, const char *name);
 void setdup(char **old, const char *str);
 char *strlower(char *in);


More information about the MPlayer-cvslog mailing list