Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
5d2c831f
Commit
5d2c831f
authored
Sep 18, 2009
by
rswindell
Browse files
Added strip_space() function to strip white-space from a string.
parent
d705aaec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
src/sbbs3/sbbs.h
src/sbbs3/sbbs.h
+1
-0
src/sbbs3/str_util.c
src/sbbs3/str_util.c
+13
-0
No files found.
src/sbbs3/sbbs.h
View file @
5d2c831f
...
...
@@ -867,6 +867,7 @@ extern "C" {
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
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
strip_ctrl
(
const
char
*
str
,
char
*
dest
);
DLLEXPORT
char
*
DLLCALL
net_addr
(
net_t
*
net
);
...
...
src/sbbs3/str_util.c
View file @
5d2c831f
...
...
@@ -101,6 +101,19 @@ char* DLLCALL strip_exascii(const char *str, char* 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
)
{
int
i
,
j
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment