summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c239d89)
raw | patch | inline | side by side (parent: c239d89)
author | Max Kellermann <max@duempel.org> | |
Sun, 21 Sep 2008 20:44:47 +0000 (22:44 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sun, 21 Sep 2008 20:44:47 +0000 (22:44 +0200) |
Check the function parameters.
src/support.c | patch | blob | history |
diff --git a/src/support.c b/src/support.c
index ad0f93bd2057d65661f479d3367f1291205297c1..6cf61137c2534c09c184a208fa1163e9beff7f9a 100644 (file)
--- a/src/support.c
+++ b/src/support.c
#include "support.h"
#include "ncmpc.h"
+#include <assert.h>
#include <time.h>
#include <ctype.h>
#include <stdio.h>
size_t
my_strlen(const char *str)
{
+ assert(str != NULL);
+
if (g_utf8_validate(str, -1, NULL)) {
size_t len = g_utf8_strlen(str, -1);
size_t width = 0;
{
char *end;
+ assert(path != NULL);
+
path = remove_trailing_slash(path);
end = path + strlen(path);
char *
strcasestr(const char *haystack, const char *needle)
{
+ assert(haystack != NULL);
+ assert(needle != NULL);
+
return strstr(lowerstr(haystack), lowerstr(needle));
}
#endif /* HAVE_STRCASESTR */
gchar *tmp, *buf;
gsize len, size;
+ assert(str != NULL);
+ assert(separator != NULL);
+ assert(st != NULL);
+
if( st->offset==0 ) {
st->offset++;
return g_strdup(str);
gsize rb, wb;
GError *error;
+ assert(utf8str != NULL);
+
if (noconvert)
return g_strdup(utf8str);
gsize rb, wb;
GError *error;
+ assert(localestr != NULL);
+
if (noconvert)
return g_strdup(localestr);