comparison gui/util/string.c @ 34628:ee78c9c66508

Add doxgen comment to gstrncmp(). Additionally, use correct data type for n.
author ib
date Mon, 13 Feb 2012 16:10:39 +0000
parents abcf26dcec6b
children 531c69f090da
comparison
equal deleted inserted replaced
34627:3482045da618 34628:ee78c9c66508
171 return -1; 171 return -1;
172 172
173 return strcasecmp(a, b); 173 return strcasecmp(a, b);
174 } 174 }
175 175
176 int gstrncmp(const char *a, const char *b, int n) 176 /**
177 * @brief A strncmp() that can handle NULL pointers.
178 *
179 * @param a string to be compared
180 * @param b string which is compared
181 * @param n number of characters compared at the most
182 *
183 * @return return value of strncmp() or -1, if a or b are NULL
184 */
185 int gstrncmp(const char *a, const char *b, size_t n)
177 { 186 {
178 if (!a && !b) 187 if (!a && !b)
179 return 0; 188 return 0;
180 if (!a || !b) 189 if (!a || !b)
181 return -1; 190 return -1;