diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-04-19 19:02:16 +0200 |
---|---|---|
committer | Colin Guthrie <cguthrie@mandriva.org> | 2009-06-08 22:31:50 +0100 |
commit | c7ec01326190a0bcdcca77307728a7dabb9fb1d2 (patch) | |
tree | 04cacef112633ddc53c2c3a559a71463a1d8f79f /src/pulse | |
parent | 4f2a3cb6019d551ca98aa2034854985df2670a30 (diff) |
util: if NULL is passed to pa_path_get_filename() just hand it through
Diffstat (limited to 'src/pulse')
-rw-r--r-- | src/pulse/util.c | 3 | ||||
-rw-r--r-- | src/pulse/util.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/pulse/util.c b/src/pulse/util.c index 54a188d5..6f1e40a9 100644 --- a/src/pulse/util.c +++ b/src/pulse/util.c @@ -219,7 +219,8 @@ char *pa_get_binary_name(char *s, size_t l) { char *pa_path_get_filename(const char *p) { char *fn; - pa_assert(p); + if (!p) + return NULL; if ((fn = strrchr(p, PA_PATH_SEP_CHAR))) return fn+1; diff --git a/src/pulse/util.h b/src/pulse/util.h index f6dd40cb..ad85653d 100644 --- a/src/pulse/util.h +++ b/src/pulse/util.h @@ -51,7 +51,7 @@ char *pa_get_home_dir(char *s, size_t l); char *pa_get_binary_name(char *s, size_t l); /** Return a pointer to the filename inside a path (which is the last - * component). */ + * component). If passed NULL will return NULL. */ char *pa_path_get_filename(const char *p); /** Wait t milliseconds */ |