summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-06-16 14:55:19 +0200
committerThomas Haller <thaller@redhat.com>2015-06-16 15:38:42 +0200
commit96bd66a7b6f72b83e50fbb563cb564f47da03a08 (patch)
treede6cb617498f68ed577f0ec2f213cc498b505f78
parent2790d9f2adec96a2655cf18b8a2f9ea2f41d6da6 (diff)
downloadNetworkManager-96bd66a7b6f72b83e50fbb563cb564f47da03a08.tar.gz
macros: add nm_strstrip() util
-rw-r--r--include/nm-macros-internal.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/nm-macros-internal.h b/include/nm-macros-internal.h
index 9be6b0f321..d9551cb090 100644
--- a/include/nm-macros-internal.h
+++ b/include/nm-macros-internal.h
@@ -214,4 +214,13 @@ nm_clear_g_source (guint *id)
/*****************************************************************************/
+static inline char *
+nm_strstrip (char *str)
+{
+ /* g_strstrip doesn't like NULL. */
+ return str ? g_strstrip (str) : NULL;
+}
+
+/*****************************************************************************/
+
#endif /* __NM_MACROS_INTERNAL_H__ */