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
21796e0b
Commit
21796e0b
authored
Aug 22, 2002
by
rswindell
Browse files
New truncate() str utility function - will truncate string at the first
occurance of any char in given set.
parent
1f3adf33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
src/sbbs3/sbbs.h
src/sbbs3/sbbs.h
+2
-1
src/sbbs3/str_util.c
src/sbbs3/str_util.c
+14
-0
No files found.
src/sbbs3/sbbs.h
View file @
21796e0b
...
...
@@ -769,7 +769,8 @@ extern "C" {
DLLEXPORT
int
DLLCALL
update_uldate
(
scfg_t
*
cfg
,
file_t
*
f
);
/* str_util.c */
DLLEXPORT
void
DLLCALL
truncsp
(
char
*
str
);
/* Truncates white spaces off end of str */
DLLEXPORT
void
DLLCALL
truncsp
(
char
*
str
);
DLLEXPORT
char
*
DLLCALL
truncate
(
char
*
str
,
const
char
*
set
);
DLLEXPORT
char
*
DLLCALL
ascii_str
(
uchar
*
str
);
DLLEXPORT
BOOL
DLLCALL
findstr
(
char
*
insearch
,
char
*
fname
);
DLLEXPORT
BOOL
DLLCALL
trashcan
(
scfg_t
*
cfg
,
char
*
insearch
,
char
*
name
);
...
...
src/sbbs3/str_util.c
View file @
21796e0b
...
...
@@ -241,6 +241,20 @@ void DLLCALL truncsp(char *str)
str
[
c
]
=
0
;
}
/****************************************************************************/
/* Truncate string at first occurance of char in specified character set */
/****************************************************************************/
char
*
DLLCALL
truncate
(
char
*
str
,
const
char
*
set
)
{
char
*
p
;
p
=
strpbrk
(
str
,
set
);
if
(
p
!=
NULL
)
*
p
=
0
;
return
(
p
);
}
/****************************************************************************/
/* Puts a backslash on path strings */
/****************************************************************************/
...
...
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