Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
07545606
Commit
07545606
authored
5 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Remove unnecessary typecasts.
parent
63da8d3e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/sbbsecho.c
+33
-33
33 additions, 33 deletions
src/sbbs3/sbbsecho.c
with
33 additions
and
33 deletions
src/sbbs3/sbbsecho.c
+
33
−
33
View file @
07545606
...
...
@@ -3319,7 +3319,7 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
smb_freemsgmem
(
&
msg
);
return
IMPORT_FAILURE
;
}
length
=
strlen
(
(
char
*
)
fbuf
);
length
=
strlen
(
fbuf
);
if
((
sbody
=
(
uchar
*
)
malloc
((
length
+
1
)
*
2
))
==
NULL
)
{
lprintf
(
LOG_ERR
,
"ERROR line %d allocating %lu bytes for body"
,
__LINE__
,(
length
+
1
)
*
2L
);
...
...
@@ -3329,7 +3329,7 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
for
(
l
=
0
,
done
=
0
,
bodylen
=
0
,
taillen
=
0
,
cr
=
1
;
l
<
length
;
l
++
)
{
if
(
!
l
&&
!
strncmp
(
(
char
*
)
fbuf
,
"AREA:"
,
5
))
{
if
(
!
l
&&
!
strncmp
(
fbuf
,
"AREA:"
,
5
))
{
save
=
l
;
l
+=
5
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
...
...
@@ -3351,26 +3351,26 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
ch
=
'@'
;
else
if
(
ch
==
CTRL_A
)
{
/* kludge line */
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"TOPT "
,
5
))
destaddr
.
point
=
atoi
(
(
char
*
)
fbuf
+
l
+
6
);
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"TOPT "
,
5
))
destaddr
.
point
=
atoi
(
fbuf
+
l
+
6
);
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"FMPT "
,
5
))
origaddr
.
point
=
atoi
(
(
char
*
)
fbuf
+
l
+
6
);
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"FMPT "
,
5
))
origaddr
.
point
=
atoi
(
fbuf
+
l
+
6
);
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"INTL "
,
5
))
{
faddr
=
atofaddr
(
(
char
*
)
fbuf
+
l
+
6
);
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"INTL "
,
5
))
{
faddr
=
atofaddr
(
fbuf
+
l
+
6
);
destaddr
.
zone
=
faddr
.
zone
;
destaddr
.
net
=
faddr
.
net
;
destaddr
.
node
=
faddr
.
node
;
l
+=
6
;
while
(
l
<
length
&&
fbuf
[
l
]
!=
' '
)
l
++
;
faddr
=
atofaddr
(
(
char
*
)
fbuf
+
l
+
1
);
faddr
=
atofaddr
(
fbuf
+
l
+
1
);
origaddr
.
zone
=
faddr
.
zone
;
origaddr
.
net
=
faddr
.
net
;
origaddr
.
node
=
faddr
.
node
;
}
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"MSGID:"
,
6
))
{
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"MSGID:"
,
6
))
{
l
+=
7
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
m
=
l
;
...
...
@@ -3379,7 +3379,7 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
smb_hfield
(
&
msg
,
FIDOMSGID
,(
ushort
)(
m
-
l
),
fbuf
+
l
);
}
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"REPLY:"
,
6
))
{
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"REPLY:"
,
6
))
{
l
+=
7
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
m
=
l
;
...
...
@@ -3388,8 +3388,8 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
smb_hfield
(
&
msg
,
FIDOREPLYID
,(
ushort
)(
m
-
l
),
fbuf
+
l
);
}
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"FLAGS "
,
6
)
/* correct */
||
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"FLAGS:"
,
6
))
{
/* incorrect */
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"FLAGS "
,
6
)
/* correct */
||
!
strncmp
(
fbuf
+
l
+
1
,
"FLAGS:"
,
6
))
{
/* incorrect */
l
+=
7
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
m
=
l
;
...
...
@@ -3399,7 +3399,7 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
smb_hfield
(
&
msg
,
FIDOFLAGS
,(
ushort
)(
m
-
l
),
fbuf
+
l
);
}
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"PATH:"
,
5
))
{
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"PATH:"
,
5
))
{
l
+=
6
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
m
=
l
;
...
...
@@ -3409,7 +3409,7 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
smb_hfield
(
&
msg
,
FIDOPATH
,(
ushort
)(
m
-
l
),
fbuf
+
l
);
}
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"PID:"
,
4
))
{
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"PID:"
,
4
))
{
l
+=
5
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
m
=
l
;
...
...
@@ -3419,7 +3419,7 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
smb_hfield
(
&
msg
,
FIDOPID
,(
ushort
)(
m
-
l
),
fbuf
+
l
);
}
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"TID:"
,
4
))
{
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"TID:"
,
4
))
{
l
+=
5
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
m
=
l
;
...
...
@@ -3429,7 +3429,7 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
smb_hfield
(
&
msg
,
FIDOTID
,(
ushort
)(
m
-
l
),
fbuf
+
l
);
}
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"NOTE:"
,
5
))
{
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"NOTE:"
,
5
))
{
l
+=
6
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
m
=
l
;
...
...
@@ -3439,7 +3439,7 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
smb_hfield
(
&
msg
,
SMB_EDITOR
,
(
ushort
)(
m
-
l
),
fbuf
+
l
);
}
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"CHRS:"
,
5
))
{
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"CHRS:"
,
5
))
{
l
+=
6
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
m
=
l
;
...
...
@@ -3450,7 +3450,7 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
}
}
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"CHARSET:"
,
8
))
{
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"CHARSET:"
,
8
))
{
l
+=
9
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
m
=
l
;
...
...
@@ -3460,19 +3460,19 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
smb_hfield
(
&
msg
,
FIDOCHARSET
,
(
ushort
)(
m
-
l
),
fbuf
+
l
);
}
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"TZUTC:"
,
6
))
{
/* FSP-1001 */
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"TZUTC:"
,
6
))
{
/* FSP-1001 */
l
+=
7
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
msg
.
hdr
.
when_written
.
zone
=
fmsgzone
(
fbuf
+
l
);
}
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"TZUTCINFO:"
,
10
))
{
/* non-standard */
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"TZUTCINFO:"
,
10
))
{
/* non-standard */
l
+=
11
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
msg
.
hdr
.
when_written
.
zone
=
fmsgzone
(
fbuf
+
l
);
}
else
if
(
!
strncmp
(
(
char
*
)
fbuf
+
l
+
1
,
"COLS:"
,
5
))
{
/* SBBSecho */
else
if
(
!
strncmp
(
fbuf
+
l
+
1
,
"COLS:"
,
5
))
{
/* SBBSecho */
l
+=
6
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
uint8_t
columns
=
atoi
(
fbuf
+
l
);
...
...
@@ -3494,10 +3494,10 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
}
if
(
ch
==
'\n'
)
continue
;
if
(
cr
&&
(
!
strncmp
(
(
char
*
)
fbuf
+
l
,
"--- "
,
4
)
||
!
strncmp
(
(
char
*
)
fbuf
+
l
,
"---
\r
"
,
4
)))
if
(
cr
&&
(
!
strncmp
(
fbuf
+
l
,
"--- "
,
4
)
||
!
strncmp
(
fbuf
+
l
,
"---
\r
"
,
4
)))
done
=
1
;
/* tear line and down go into tail */
else
if
(
cr
&&
!
strncmp
(
(
char
*
)
fbuf
+
l
,
" * Origin: "
,
11
))
{
else
if
(
cr
&&
!
strncmp
(
fbuf
+
l
,
" * Origin: "
,
11
))
{
p
=
(
char
*
)
fbuf
+
l
+
11
;
while
(
*
p
&&
*
p
!=
'\r'
)
p
++
;
/* Find CR */
while
(
p
&&
*
p
!=
'('
)
p
--
;
/* rewind to '(' */
...
...
@@ -3505,7 +3505,7 @@ int fmsgtosmsg(char* fbuf, fmsghdr_t* hdr, uint user, uint subnum)
origaddr
=
atofaddr
(
p
+
1
);
/* get orig address */
done
=
1
;
}
else
if
(
done
&&
cr
&&
!
strncmp
(
(
char
*
)
fbuf
+
l
,
"SEEN-BY:"
,
8
))
{
else
if
(
done
&&
cr
&&
!
strncmp
(
fbuf
+
l
,
"SEEN-BY:"
,
8
))
{
l
+=
8
;
while
(
l
<
length
&&
fbuf
[
l
]
<=
' '
&&
fbuf
[
l
]
>=
0
)
l
++
;
m
=
l
;
...
...
@@ -3711,11 +3711,11 @@ void putfmsg(FILE* stream, const char* fbuf, fmsghdr_t* hdr, area_t area
if
(
area
.
tag
==
NULL
&&
strstr
(
fbuf
,
"
\1
INTL "
)
==
NULL
)
/* NetMail, so add FSC-0004 INTL kludge */
fwrite_intl_control_line
(
stream
,
hdr
);
/* If not already present */
len
=
strlen
(
(
char
*
)
fbuf
);
len
=
strlen
(
fbuf
);
/* Write message body */
if
(
area
.
tag
)
if
(
strncmp
(
(
char
*
)
fbuf
,
"AREA:"
,
5
))
/* No AREA: Line */
if
(
strncmp
(
fbuf
,
"AREA:"
,
5
))
/* No AREA: Line */
fprintf
(
stream
,
"AREA:%s
\r
"
,
area
.
tag
);
/* So add one */
(
void
)
fwrite
(
fbuf
,
len
,
1
,
stream
);
lastlen
=
9
;
...
...
@@ -3916,8 +3916,8 @@ void gen_psb(addrlist_t *seenbys, addrlist_t *paths, const char *inbuf, uint16_t
fbuf
=
inbuf
;
FREE_AND_NULL
(
seenbys
->
addr
);
addr
.
zone
=
addr
.
net
=
addr
.
node
=
addr
.
point
=
seenbys
->
addrs
=
0
;
p
=
strstr
(
(
char
*
)
fbuf
,
"
\r
SEEN-BY:"
);
if
(
!
p
)
p
=
strstr
(
(
char
*
)
fbuf
,
"
\n
SEEN-BY:"
);
p
=
strstr
(
fbuf
,
"
\r
SEEN-BY:"
);
if
(
!
p
)
p
=
strstr
(
fbuf
,
"
\n
SEEN-BY:"
);
if
(
p
)
{
while
(
1
)
{
sprintf
(
str
,
"%-.100s"
,
p
+
10
);
...
...
@@ -3979,7 +3979,7 @@ void gen_psb(addrlist_t *seenbys, addrlist_t *paths, const char *inbuf, uint16_t
FREE_AND_NULL
(
paths
->
addr
);
addr
.
zone
=
addr
.
net
=
addr
.
node
=
addr
.
point
=
paths
->
addrs
=
0
;
if
((
p
=
strstr
(
(
char
*
)
fbuf
,
"
\1
PATH:"
))
!=
NULL
)
{
if
((
p
=
strstr
(
fbuf
,
"
\1
PATH:"
))
!=
NULL
)
{
while
(
1
)
{
sprintf
(
str
,
"%-.100s"
,
p
+
7
);
if
((
p1
=
strchr
(
str
,
'\r'
))
!=
NULL
)
...
...
@@ -4073,9 +4073,9 @@ void strip_psb(char *inbuf)
fbuf
=
strstr
(
inbuf
,
FIDO_ORIGIN_PREFIX_FORM_2
);
if
(
!
fbuf
)
fbuf
=
inbuf
;
if
((
p
=
strstr
(
(
char
*
)
fbuf
,
"
\r
SEEN-BY:"
))
!=
NULL
)
if
((
p
=
strstr
(
fbuf
,
"
\r
SEEN-BY:"
))
!=
NULL
)
*
(
p
)
=
0
;
if
((
p
=
strstr
(
(
char
*
)
fbuf
,
"
\r\1
PATH:"
))
!=
NULL
)
if
((
p
=
strstr
(
fbuf
,
"
\r\1
PATH:"
))
!=
NULL
)
*
(
p
)
=
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment