]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add util
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 5 Jun 2007 16:21:30 +0000 (16:21 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 5 Jun 2007 16:21:30 +0000 (16:21 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5265 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_utils.h

index aca1596ccbfe1bf93fddfafaa188c1ddfcf72ff7..cef526e0089eae21ad4f27dc4b8ff9c2d835703e 100644 (file)
@@ -177,6 +177,15 @@ switch_mutex_unlock(obj->flag_mutex);
 
 #define switch_set_string(_dst, _src) switch_copy_string(_dst, _src, sizeof(_dst))
 
+static __inline__ void switch_clean_string(char *s)
+{                                                                                                                                                                   char *p;
+
+    for (p = s; p && *p; p++) {                                                                                                                                         uint8_t x = (uint8_t) *p;                                                                                                                                       if (x < 32 || x > 127) {                                                                                                                                            *p = ' ';                                                                                                                                                   }
+    }
+}
+
+
+
 /*!
   \brief Free a pointer and set it to NULL unless it already is NULL
   \param it the pointer