Commit 5d2c831f authored by rswindell's avatar rswindell
Browse files

Added strip_space() function to strip white-space from a string.

parent d705aaec
...@@ -867,6 +867,7 @@ extern "C" { ...@@ -867,6 +867,7 @@ extern "C" {
DLLEXPORT char * DLLCALL trashcan_fname(scfg_t* cfg, const char *name, char* fname, size_t); DLLEXPORT char * DLLCALL trashcan_fname(scfg_t* cfg, const char *name, char* fname, size_t);
DLLEXPORT str_list_t DLLCALL trashcan_list(scfg_t* cfg, const char* name); DLLEXPORT str_list_t DLLCALL trashcan_list(scfg_t* cfg, const char* name);
DLLEXPORT char * DLLCALL strip_exascii(const char *str, char* dest); DLLEXPORT char * DLLCALL strip_exascii(const char *str, char* dest);
DLLEXPORT char * DLLCALL strip_space(const char *str, char* dest);
DLLEXPORT char * DLLCALL prep_file_desc(const char *str, char* dest); DLLEXPORT char * DLLCALL prep_file_desc(const char *str, char* dest);
DLLEXPORT char * DLLCALL strip_ctrl(const char *str, char* dest); DLLEXPORT char * DLLCALL strip_ctrl(const char *str, char* dest);
DLLEXPORT char * DLLCALL net_addr(net_t* net); DLLEXPORT char * DLLCALL net_addr(net_t* net);
......
...@@ -101,6 +101,19 @@ char* DLLCALL strip_exascii(const char *str, char* dest) ...@@ -101,6 +101,19 @@ char* DLLCALL strip_exascii(const char *str, char* dest)
return dest; return dest;
} }
char* DLLCALL strip_space(const char *str, char* dest)
{
int i,j;
if(dest==NULL && (dest=strdup(str))==NULL)
return NULL;
for(i=j=0;str[i];i++)
if(!isspace(str[i]))
dest[j++]=str[i];
dest[j]=0;
return dest;
}
char* DLLCALL prep_file_desc(const char *str, char* dest) char* DLLCALL prep_file_desc(const char *str, char* dest)
{ {
int i,j; int i,j;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment