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
e421382b
Commit
e421382b
authored
Jun 14, 2003
by
rswindell
Browse files
strip_ctrl() only overwrites string if it was modified.
parent
2188016f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
src/sbbs3/str_util.c
src/sbbs3/str_util.c
+6
-3
No files found.
src/sbbs3/str_util.c
View file @
e421382b
...
...
@@ -64,13 +64,16 @@ char* DLLCALL strip_ctrl(char *str)
char
tmp
[
1024
];
int
i
,
j
;
for
(
i
=
j
=
0
;
str
[
i
]
&&
j
<
(
int
)
sizeof
(
tmp
)
-
1
;
i
++
)
for
(
i
=
j
=
0
;
str
[
i
]
&&
j
<
(
int
)
sizeof
(
tmp
)
-
1
;
i
++
)
{
if
(
str
[
i
]
==
CTRL_A
&&
str
[
i
+
1
]
!=
0
)
i
++
;
else
if
((
uchar
)
str
[
i
]
>=
SP
)
tmp
[
j
++
]
=
str
[
i
];
tmp
[
j
]
=
0
;
strcpy
(
str
,
tmp
);
}
if
(
i
!=
j
)
{
tmp
[
j
]
=
0
;
strcpy
(
str
,
tmp
);
}
return
(
str
);
}
...
...
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