Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
8ba66a86
Commit
8ba66a86
authored
May 27, 2015
by
vvaltman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proper way to handle interface errors
parent
f9a7f195
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
interface.c
interface.c
+3
-3
No files found.
interface.c
View file @
8ba66a86
...
...
@@ -126,6 +126,8 @@ int is_same_word (const char *s, size_t l, const char *word) {
return
s
&&
word
&&
strlen
(
word
)
==
l
&&
!
memcmp
(
s
,
word
,
l
);
}
void
fail_interface
(
struct
tgl_state
*
TLS
,
struct
in_ev
*
ev
,
int
error_code
,
const
char
*
format
,
...)
__attribute__
((
format
(
printf
,
4
,
5
)));
static
void
skip_wspc
(
void
)
{
while
(
*
line_ptr
&&
((
unsigned
char
)
*
line_ptr
)
<=
' '
)
{
line_ptr
++
;
...
...
@@ -1140,9 +1142,7 @@ void do_send_typing (struct command *command, int arg_num, struct arg args[], st
enum
tgl_typing_status
status
=
tgl_typing_typing
;
//de
if
(
args
[
1
].
num
!=
NOT_FOUND
)
{
if
(
args
[
1
].
num
>
0
&&
args
[
1
].
num
>
10
)
{
TLS
->
error_code
=
ENOSYS
;
TLS
->
error
=
strdup
(
"illegal typing status"
);
print_fail
(
ev
);
fail_interface
(
TLS
,
ev
,
ENOSYS
,
"illegal typing status"
);
return
;
}
status
=
(
enum
tgl_typing_status
)
args
[
1
].
num
;
// if the status parameter is given, and is in range.
...
...
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