Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Synchronet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
127
Issues
127
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main
Synchronet
Commits
1aa52dba
Commit
1aa52dba
authored
Sep 20, 2005
by
deuce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scrape out some of the 16-bit cruft.
parent
53099a27
Changes
65
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
65 changed files
with
698 additions
and
703 deletions
+698
-703
src/sbbs3/addfiles.c
src/sbbs3/addfiles.c
+2
-2
src/sbbs3/baja.c
src/sbbs3/baja.c
+20
-20
src/sbbs3/chat.cpp
src/sbbs3/chat.cpp
+15
-15
src/sbbs3/chat/MainFormUnit.cpp
src/sbbs3/chat/MainFormUnit.cpp
+2
-2
src/sbbs3/chksmb.c
src/sbbs3/chksmb.c
+3
-3
src/sbbs3/ctrl/StatsLogFormUnit.cpp
src/sbbs3/ctrl/StatsLogFormUnit.cpp
+1
-1
src/sbbs3/delfiles.c
src/sbbs3/delfiles.c
+5
-5
src/sbbs3/dupefind.c
src/sbbs3/dupefind.c
+9
-9
src/sbbs3/echocfg.c
src/sbbs3/echocfg.c
+12
-12
src/sbbs3/exec.cpp
src/sbbs3/exec.cpp
+14
-14
src/sbbs3/execfunc.cpp
src/sbbs3/execfunc.cpp
+1
-1
src/sbbs3/execmisc.cpp
src/sbbs3/execmisc.cpp
+24
-24
src/sbbs3/fido.cpp
src/sbbs3/fido.cpp
+21
-21
src/sbbs3/file.cpp
src/sbbs3/file.cpp
+3
-3
src/sbbs3/filedat.c
src/sbbs3/filedat.c
+26
-26
src/sbbs3/filelist.c
src/sbbs3/filelist.c
+9
-9
src/sbbs3/finddupes.c
src/sbbs3/finddupes.c
+3
-8
src/sbbs3/getmail.c
src/sbbs3/getmail.c
+2
-2
src/sbbs3/getmsg.cpp
src/sbbs3/getmsg.cpp
+1
-1
src/sbbs3/getnode.cpp
src/sbbs3/getnode.cpp
+8
-8
src/sbbs3/install/sbbsinst.c
src/sbbs3/install/sbbsinst.c
+15
-15
src/sbbs3/js_bbs.cpp
src/sbbs3/js_bbs.cpp
+8
-8
src/sbbs3/js_global.c
src/sbbs3/js_global.c
+1
-1
src/sbbs3/listfile.cpp
src/sbbs3/listfile.cpp
+32
-32
src/sbbs3/logout.cpp
src/sbbs3/logout.cpp
+3
-3
src/sbbs3/mail.cpp
src/sbbs3/mail.cpp
+7
-7
src/sbbs3/mailsrvr.c
src/sbbs3/mailsrvr.c
+1
-1
src/sbbs3/main.cpp
src/sbbs3/main.cpp
+39
-39
src/sbbs3/msgtoqwk.cpp
src/sbbs3/msgtoqwk.cpp
+2
-2
src/sbbs3/pack_qwk.cpp
src/sbbs3/pack_qwk.cpp
+5
-5
src/sbbs3/pack_rep.cpp
src/sbbs3/pack_rep.cpp
+6
-6
src/sbbs3/prntfile.cpp
src/sbbs3/prntfile.cpp
+4
-4
src/sbbs3/putmsg.cpp
src/sbbs3/putmsg.cpp
+1
-1
src/sbbs3/qwk.cpp
src/sbbs3/qwk.cpp
+20
-20
src/sbbs3/qwknodes.c
src/sbbs3/qwknodes.c
+3
-3
src/sbbs3/qwktomsg.cpp
src/sbbs3/qwktomsg.cpp
+7
-7
src/sbbs3/readmail.cpp
src/sbbs3/readmail.cpp
+4
-4
src/sbbs3/readmsgs.cpp
src/sbbs3/readmsgs.cpp
+24
-24
src/sbbs3/rechocfg.c
src/sbbs3/rechocfg.c
+11
-11
src/sbbs3/sbbs.h
src/sbbs3/sbbs.h
+3
-3
src/sbbs3/sbbsecho.c
src/sbbs3/sbbsecho.c
+32
-32
src/sbbs3/scfg/scfg.c
src/sbbs3/scfg/scfg.c
+10
-10
src/sbbs3/scfg/scfgchat.c
src/sbbs3/scfg/scfgchat.c
+15
-15
src/sbbs3/scfg/scfgmdm.c
src/sbbs3/scfg/scfgmdm.c
+6
-6
src/sbbs3/scfg/scfgmsg.c
src/sbbs3/scfg/scfgmsg.c
+6
-6
src/sbbs3/scfg/scfgnet.c
src/sbbs3/scfg/scfgnet.c
+13
-13
src/sbbs3/scfg/scfgnode.c
src/sbbs3/scfg/scfgnode.c
+1
-1
src/sbbs3/scfg/scfgsub.c
src/sbbs3/scfg/scfgsub.c
+3
-3
src/sbbs3/scfg/scfgxfr1.c
src/sbbs3/scfg/scfgxfr1.c
+28
-28
src/sbbs3/scfg/scfgxfr2.c
src/sbbs3/scfg/scfgxfr2.c
+9
-9
src/sbbs3/scfg/scfgxtrn.c
src/sbbs3/scfg/scfgxtrn.c
+19
-19
src/sbbs3/scfglib1.c
src/sbbs3/scfglib1.c
+15
-15
src/sbbs3/scfglib2.c
src/sbbs3/scfglib2.c
+44
-44
src/sbbs3/smbactiv.c
src/sbbs3/smbactiv.c
+2
-2
src/sbbs3/smbutil.c
src/sbbs3/smbutil.c
+8
-8
src/sbbs3/sortdir.cpp
src/sbbs3/sortdir.cpp
+17
-17
src/sbbs3/str.cpp
src/sbbs3/str.cpp
+15
-15
src/sbbs3/text_sec.cpp
src/sbbs3/text_sec.cpp
+6
-6
src/sbbs3/tmp_xfer.cpp
src/sbbs3/tmp_xfer.cpp
+2
-2
src/sbbs3/uedit/uedit.c
src/sbbs3/uedit/uedit.c
+32
-32
src/sbbs3/umonitor/chat.c
src/sbbs3/umonitor/chat.c
+2
-2
src/sbbs3/umonitor/umonitor.c
src/sbbs3/umonitor/umonitor.c
+19
-19
src/sbbs3/userdat.c
src/sbbs3/userdat.c
+1
-1
src/sbbs3/writemsg.cpp
src/sbbs3/writemsg.cpp
+7
-7
src/sbbs3/xtrn_sec.cpp
src/sbbs3/xtrn_sec.cpp
+9
-9
No files found.
src/sbbs3/addfiles.c
View file @
1aa52dba
...
...
@@ -555,14 +555,14 @@ void synclist(char *inpath, int dirnum)
printf
(
"ERR_LEN (%ld) of %s
\n
"
,
length
,
str
);
return
;
}
if
((
ixbbuf
=
(
uchar
HUGE16
*
)
MALLOC
(
length
))
==
NULL
)
{
if
((
ixbbuf
=
(
uchar
*
)
malloc
(
length
))
==
NULL
)
{
close
(
file
);
printf
(
"ERR_ALLOC %s
\n
"
,
str
);
return
;
}
if
(
lread
(
file
,
ixbbuf
,
length
)
!=
length
)
{
close
(
file
);
FREE
((
char
*
)
ixbbuf
);
free
((
char
*
)
ixbbuf
);
printf
(
"ERR_READ %s
\n
"
,
str
);
return
;
}
...
...
src/sbbs3/baja.c
View file @
1aa52dba
...
...
@@ -333,7 +333,7 @@ void newvar(uchar* src, uchar *in)
if
(
i
<
vars
)
return
;
}
if
((
var_name
=
(
ulong
*
)
REALLOC
(
var_name
,
sizeof
(
long
)
*
(
vars
+
1
)))
==
NULL
)
{
if
((
var_name
=
(
ulong
*
)
realloc
(
var_name
,
sizeof
(
long
)
*
(
vars
+
1
)))
==
NULL
)
{
printf
(
"Too many (%lu) variables!
\n
"
,
vars
);
bail
(
1
);
}
var_name
[
vars
]
=
l
;
...
...
@@ -532,18 +532,18 @@ void compile(char *src)
if
(
sp
)
*
sp
=
0
;
truncsp
(
arg2
);
if
((
define_str
=
(
char
**
)
REALLOC
(
define_str
,
sizeof
(
char
*
)
*
(
defines
+
1
)))
if
((
define_str
=
(
char
**
)
realloc
(
define_str
,
sizeof
(
char
*
)
*
(
defines
+
1
)))
==
NULL
)
{
printf
(
"Too many defines.
\n
"
);
bail
(
1
);
}
if
((
define_str
[
defines
]
=
(
char
*
)
MALLOC
(
strlen
(
arg
)
+
1
))
==
NULL
)
{
if
((
define_str
[
defines
]
=
(
char
*
)
malloc
(
strlen
(
arg
)
+
1
))
==
NULL
)
{
printf
(
"Too many defines.
\n
"
);
bail
(
1
);
}
if
((
define_val
=
(
char
**
)
REALLOC
(
define_val
,
sizeof
(
char
*
)
*
(
defines
+
1
)))
if
((
define_val
=
(
char
**
)
realloc
(
define_val
,
sizeof
(
char
*
)
*
(
defines
+
1
)))
==
NULL
)
{
printf
(
"Too many defines.
\n
"
);
bail
(
1
);
}
if
((
define_val
[
defines
]
=
(
char
*
)
MALLOC
(
strlen
(
arg2
)
+
1
))
==
NULL
)
{
if
((
define_val
[
defines
]
=
(
char
*
)
malloc
(
strlen
(
arg2
)
+
1
))
==
NULL
)
{
printf
(
"Too many defines.
\n
"
);
bail
(
1
);
}
strcpy
(
define_str
[
defines
],
arg
);
...
...
@@ -728,15 +728,15 @@ void compile(char *src)
printf
(
"!SYNTAX ERROR (duplicate label name):
\n
"
);
printf
(
linestr
,
src
,
line
,
p
);
bail
(
1
);
}
if
((
label_name
=
(
char
**
)
REALLOC
(
label_name
,
sizeof
(
char
*
)
*
(
labels
+
1
)))
if
((
label_name
=
(
char
**
)
realloc
(
label_name
,
sizeof
(
char
*
)
*
(
labels
+
1
)))
==
NULL
)
{
printf
(
"Too many labels.
\n
"
);
bail
(
1
);
}
if
((
label_indx
=
(
uint
*
)
REALLOC
(
label_indx
,
sizeof
(
int
)
*
(
labels
+
1
)))
if
((
label_indx
=
(
uint
*
)
realloc
(
label_indx
,
sizeof
(
int
)
*
(
labels
+
1
)))
==
NULL
)
{
printf
(
"Too many labels.
\n
"
);
bail
(
1
);
}
if
((
label_name
[
labels
]
=
(
char
*
)
MALLOC
(
strlen
(
p
)
+
1
))
==
NULL
)
{
if
((
label_name
[
labels
]
=
(
char
*
)
malloc
(
strlen
(
p
)
+
1
))
==
NULL
)
{
printf
(
"Too many labels.
\n
"
);
bail
(
1
);
}
strcpy
(
label_name
[
labels
],
p
);
...
...
@@ -748,26 +748,26 @@ void compile(char *src)
sp
=
strchr
(
arg
,
' '
);
if
(
sp
)
*
sp
=
0
;
if
((
goto_label
=
(
char
**
)
REALLOC
(
goto_label
,
sizeof
(
char
*
)
*
(
gotos
+
1
)))
if
((
goto_label
=
(
char
**
)
realloc
(
goto_label
,
sizeof
(
char
*
)
*
(
gotos
+
1
)))
==
NULL
)
{
printf
(
"Too many gotos.
\n
"
);
bail
(
1
);
}
if
((
goto_file
=
(
char
**
)
REALLOC
(
goto_file
,
sizeof
(
char
*
)
*
(
gotos
+
1
)))
if
((
goto_file
=
(
char
**
)
realloc
(
goto_file
,
sizeof
(
char
*
)
*
(
gotos
+
1
)))
==
NULL
)
{
printf
(
"Too many gotos.
\n
"
);
bail
(
1
);
}
if
((
goto_indx
=
(
uint
*
)
REALLOC
(
goto_indx
,
sizeof
(
int
)
*
(
gotos
+
1
)))
if
((
goto_indx
=
(
uint
*
)
realloc
(
goto_indx
,
sizeof
(
int
)
*
(
gotos
+
1
)))
==
NULL
)
{
printf
(
"Too many gotos.
\n
"
);
bail
(
1
);
}
if
((
goto_line
=
(
uint
*
)
REALLOC
(
goto_line
,
sizeof
(
int
)
*
(
gotos
+
1
)))
if
((
goto_line
=
(
uint
*
)
realloc
(
goto_line
,
sizeof
(
int
)
*
(
gotos
+
1
)))
==
NULL
)
{
printf
(
"Too many gotos.
\n
"
);
bail
(
1
);
}
if
((
goto_label
[
gotos
]
=
(
char
*
)
MALLOC
(
strlen
(
arg
)
+
1
))
==
NULL
)
{
if
((
goto_label
[
gotos
]
=
(
char
*
)
malloc
(
strlen
(
arg
)
+
1
))
==
NULL
)
{
printf
(
"Too many gotos.
\n
"
);
bail
(
1
);
}
if
((
goto_file
[
gotos
]
=
(
char
*
)
MALLOC
(
strlen
(
str
)
+
1
))
==
NULL
)
{
if
((
goto_file
[
gotos
]
=
(
char
*
)
malloc
(
strlen
(
str
)
+
1
))
==
NULL
)
{
printf
(
"Too many gotos.
\n
"
);
bail
(
1
);
}
strcpy
(
goto_label
[
gotos
],
arg
);
...
...
@@ -782,26 +782,26 @@ void compile(char *src)
sp
=
strchr
(
arg
,
' '
);
if
(
sp
)
*
sp
=
0
;
if
((
call_label
=
(
char
**
)
REALLOC
(
call_label
,
sizeof
(
char
*
)
*
(
calls
+
1
)))
if
((
call_label
=
(
char
**
)
realloc
(
call_label
,
sizeof
(
char
*
)
*
(
calls
+
1
)))
==
NULL
)
{
printf
(
"Too many calls.
\n
"
);
bail
(
1
);
}
if
((
call_file
=
(
char
**
)
REALLOC
(
call_file
,
sizeof
(
char
*
)
*
(
calls
+
1
)))
if
((
call_file
=
(
char
**
)
realloc
(
call_file
,
sizeof
(
char
*
)
*
(
calls
+
1
)))
==
NULL
)
{
printf
(
"Too many calls.
\n
"
);
bail
(
1
);
}
if
((
call_indx
=
(
uint
*
)
REALLOC
(
call_indx
,
sizeof
(
int
)
*
(
calls
+
1
)))
if
((
call_indx
=
(
uint
*
)
realloc
(
call_indx
,
sizeof
(
int
)
*
(
calls
+
1
)))
==
NULL
)
{
printf
(
"Too many calls.
\n
"
);
bail
(
1
);
}
if
((
call_line
=
(
uint
*
)
REALLOC
(
call_line
,
sizeof
(
int
)
*
(
calls
+
1
)))
if
((
call_line
=
(
uint
*
)
realloc
(
call_line
,
sizeof
(
int
)
*
(
calls
+
1
)))
==
NULL
)
{
printf
(
"Too many calls.
\n
"
);
bail
(
1
);
}
if
((
call_label
[
calls
]
=
(
char
*
)
MALLOC
(
strlen
(
arg
)
+
1
))
==
NULL
)
{
if
((
call_label
[
calls
]
=
(
char
*
)
malloc
(
strlen
(
arg
)
+
1
))
==
NULL
)
{
printf
(
"Too many calls.
\n
"
);
bail
(
1
);
}
if
((
call_file
[
calls
]
=
(
char
*
)
MALLOC
(
strlen
(
src
)
+
1
))
==
NULL
)
{
if
((
call_file
[
calls
]
=
(
char
*
)
malloc
(
strlen
(
src
)
+
1
))
==
NULL
)
{
printf
(
"Too many calls.
\n
"
);
bail
(
1
);
}
...
...
src/sbbs3/chat.cpp
View file @
1aa52dba
...
...
@@ -77,7 +77,7 @@ void sbbs_t::multinodechat(int channel)
}
bprintf
(
text
[
WelcomeToChannelN
],
channel
,
cfg
.
chan
[
channel
-
1
]
->
name
);
if
(
gurubuf
)
{
FREE
(
gurubuf
);
free
(
gurubuf
);
gurubuf
=
NULL
;
}
if
(
cfg
.
chan
[
channel
-
1
]
->
misc
&
CHAN_GURU
&&
cfg
.
chan
[
channel
-
1
]
->
guru
<
cfg
.
total_gurus
&&
chk_ar
(
cfg
.
guru
[
cfg
.
chan
[
channel
-
1
]
->
guru
]
->
ar
,
&
useron
))
{
...
...
@@ -85,7 +85,7 @@ void sbbs_t::multinodechat(int channel)
if
((
file
=
nopen
(
str
,
O_RDONLY
))
==-
1
)
{
errormsg
(
WHERE
,
ERR_OPEN
,
str
,
O_RDONLY
);
return
;
}
if
((
gurubuf
=
(
char
*
)
MALLOC
(
filelength
(
file
)
+
1
))
==
NULL
)
{
if
((
gurubuf
=
(
char
*
)
malloc
(
filelength
(
file
)
+
1
))
==
NULL
)
{
close
(
file
);
errormsg
(
WHERE
,
ERR_ALLOC
,
str
,
filelength
(
file
)
+
1
);
return
;
}
...
...
@@ -211,7 +211,7 @@ void sbbs_t::multinodechat(int channel)
bputs
(
text
[
WrongPassword
]);
continue
;
}
if
(
gurubuf
)
{
FREE
(
gurubuf
);
free
(
gurubuf
);
gurubuf
=
NULL
;
}
if
(
cfg
.
chan
[
savch
-
1
]
->
misc
&
CHAN_GURU
&&
cfg
.
chan
[
savch
-
1
]
->
guru
<
cfg
.
total_gurus
...
...
@@ -222,7 +222,7 @@ void sbbs_t::multinodechat(int channel)
if
((
file
=
nopen
(
str
,
O_RDONLY
))
==-
1
)
{
errormsg
(
WHERE
,
ERR_OPEN
,
str
,
O_RDONLY
);
break
;
}
if
((
gurubuf
=
(
char
*
)
MALLOC
(
filelength
(
file
)
+
1
))
==
NULL
)
{
if
((
gurubuf
=
(
char
*
)
malloc
(
filelength
(
file
)
+
1
))
==
NULL
)
{
close
(
file
);
errormsg
(
WHERE
,
ERR_ALLOC
,
str
,
filelength
(
file
)
+
1
);
...
...
@@ -537,7 +537,7 @@ bool sbbs_t::guru_page(void)
errormsg
(
WHERE
,
ERR_OPEN
,
path
,
O_RDONLY
);
return
(
false
);
}
if
((
gurubuf
=
(
char
*
)
MALLOC
(
filelength
(
file
)
+
1
))
==
NULL
)
{
if
((
gurubuf
=
(
char
*
)
malloc
(
filelength
(
file
)
+
1
))
==
NULL
)
{
close
(
file
);
errormsg
(
WHERE
,
ERR_ALLOC
,
path
,
filelength
(
file
)
+
1
);
return
(
false
);
...
...
@@ -546,7 +546,7 @@ bool sbbs_t::guru_page(void)
gurubuf
[
filelength
(
file
)]
=
0
;
close
(
file
);
localguru
(
gurubuf
,
i
);
FREE
(
gurubuf
);
free
(
gurubuf
);
return
(
true
);
}
...
...
@@ -632,7 +632,7 @@ void sbbs_t::chatsection()
default:
/* 'Q' or <CR> */
lncntr
=
0
;
// if(gurubuf)
//
FREE
(gurubuf);
//
free
(gurubuf);
return
;
}
action
=
NODE_CHAT
;
if
(
!
(
useron
.
misc
&
EXPERT
)
||
useron
.
misc
&
(
WIP
|
HTML
)
...
...
@@ -642,7 +642,7 @@ void sbbs_t::chatsection()
ASYNC
;
bputs
(
text
[
ChatPrompt
]);
}
// if(gurubuf)
//
FREE
(gurubuf);
//
free
(gurubuf);
}
/****************************************************************************/
...
...
@@ -832,7 +832,7 @@ void sbbs_t::privchat(bool local)
errormsg
(
WHERE
,
ERR_OPEN
,
str
,
O_RDWR
|
O_DENYNONE
|
O_CREAT
);
return
;
}
if
((
p
=
(
char
*
)
MALLOC
(
PCHAT_LEN
))
==
NULL
)
{
if
((
p
=
(
char
*
)
malloc
(
PCHAT_LEN
))
==
NULL
)
{
close
(
in
);
close
(
out
);
errormsg
(
WHERE
,
ERR_ALLOC
,
str
,
PCHAT_LEN
);
...
...
@@ -840,7 +840,7 @@ void sbbs_t::privchat(bool local)
memset
(
p
,
0
,
PCHAT_LEN
);
write
(
in
,
p
,
PCHAT_LEN
);
write
(
out
,
p
,
PCHAT_LEN
);
FREE
(
p
);
free
(
p
);
lseek
(
in
,
0L
,
SEEK_SET
);
lseek
(
out
,
0L
,
SEEK_SET
);
...
...
@@ -1431,11 +1431,11 @@ void sbbs_t::guruchat(char* line, char* gurubuf, int gurunum, char* last_answer)
localtime_r
(
&
now
,
&
tm
);
for
(
i
=
0
;
i
<
100
;
i
++
)
{
if
((
answer
[
i
]
=
(
char
*
)
MALLOC
(
512
))
==
NULL
)
{
if
((
answer
[
i
]
=
(
char
*
)
malloc
(
512
))
==
NULL
)
{
errormsg
(
WHERE
,
ERR_ALLOC
,
nulstr
,
512
);
while
(
i
)
{
i
--
;
FREE
(
answer
[
i
]);
}
free
(
answer
[
i
]);
}
sys_status
&=~
SS_GURUCHAT
;
return
;
}
}
ptr
=
gurubuf
;
...
...
@@ -1459,7 +1459,7 @@ void sbbs_t::guruchat(char* line, char* gurubuf, int gurunum, char* last_answer)
break
;
}
if
(
k
<
1
)
{
for
(
i
=
0
;
i
<
100
;
i
++
)
FREE
(
answer
[
i
]);
free
(
answer
[
i
]);
return
;
}
if
(
cstr
[
k
+
1
]
==
'?'
)
k
++
;
...
...
@@ -1682,7 +1682,7 @@ void sbbs_t::guruchat(char* line, char* gurubuf, int gurunum, char* last_answer)
hangup
();
break
;
}
}
for
(
i
=
0
;
i
<
100
;
i
++
)
FREE
(
answer
[
i
]);
free
(
answer
[
i
]);
}
/****************************************************************************/
...
...
@@ -1711,7 +1711,7 @@ bool sbbs_t::guruexp(char **ptrptr, char *line)
ar
=
arstr
(
NULL
,
str
,
&
cfg
);
c
=
chk_ar
(
ar
,
&
useron
);
if
(
ar
[
0
]
!=
AR_NULL
)
FREE
(
ar
);
free
(
ar
);
if
(
!
c
&&
_and
)
{
result
=
false
;
break
;
}
...
...
src/sbbs3/chat/MainFormUnit.cpp
View file @
1aa52dba
...
...
@@ -147,7 +147,7 @@ void __fastcall TMainForm::FormShow(TObject *Sender)
return
;
}
if
((
p
=
(
char
*
)
MALLOC
(
PCHAT_LEN
))
==
NULL
)
{
if
((
p
=
(
char
*
)
malloc
(
PCHAT_LEN
))
==
NULL
)
{
close
(
in
);
close
(
out
);
Remote
->
Lines
->
Add
(
"!Error allocating memory"
);
...
...
@@ -156,7 +156,7 @@ void __fastcall TMainForm::FormShow(TObject *Sender)
memset
(
p
,
0
,
PCHAT_LEN
);
write
(
in
,
p
,
PCHAT_LEN
);
write
(
out
,
p
,
PCHAT_LEN
);
FREE
(
p
);
free
(
p
);
lseek
(
in
,
0L
,
SEEK_SET
);
lseek
(
out
,
0L
,
SEEK_SET
);
...
...
src/sbbs3/chksmb.c
View file @
1aa52dba
...
...
@@ -239,7 +239,7 @@ int main(int argc, char **argv)
}
if
((
length
/
SHD_BLOCK_LEN
)
*
sizeof
(
ulong
))
{
if
((
number
=
(
ulong
*
)
MALLOC
(((
length
/
SHD_BLOCK_LEN
)
+
2
)
*
sizeof
(
ulong
)))
if
((
number
=
(
ulong
*
)
malloc
(((
length
/
SHD_BLOCK_LEN
)
+
2
)
*
sizeof
(
ulong
)))
==
NULL
)
{
printf
(
"Error allocating %lu bytes of memory
\n
"
,(
length
/
SHD_BLOCK_LEN
)
*
sizeof
(
ulong
));
...
...
@@ -662,11 +662,11 @@ int main(int argc, char **argv)
fprintf
(
stderr
,
"
\n
Checking %s Index
\n\n
"
,
smb
.
file
);
if
((
offset
=
(
ulong
*
)
MALLOC
(
total
*
sizeof
(
ulong
)))
==
NULL
)
{
if
((
offset
=
(
ulong
*
)
malloc
(
total
*
sizeof
(
ulong
)))
==
NULL
)
{
printf
(
"Error allocating %lu bytes of memory
\n
"
,
total
*
sizeof
(
ulong
));
return
(
++
errors
);
}
if
((
number
=
(
ulong
*
)
MALLOC
(
total
*
sizeof
(
ulong
)))
==
NULL
)
{
if
((
number
=
(
ulong
*
)
malloc
(
total
*
sizeof
(
ulong
)))
==
NULL
)
{
printf
(
"Error allocating %lu bytes of memory
\n
"
,
total
*
sizeof
(
ulong
));
return
(
++
errors
);
}
...
...
src/sbbs3/ctrl/StatsLogFormUnit.cpp
View file @
1aa52dba
...
...
@@ -84,7 +84,7 @@ void __fastcall TStatsLogForm::FormShow(TObject *Sender)
close
(
file
);
return
;
}
if
((
buf
=
(
char
*
)
MALLOC
(
length
))
==
NULL
)
{
if
((
buf
=
(
char
*
)
malloc
(
length
))
==
NULL
)
{
close
(
file
);
sprintf
(
str
,
"!Error allocating %lu bytes"
,
length
);
Log
->
Lines
->
Add
(
AnsiString
(
str
));
...
...
src/sbbs3/delfiles.c
View file @
1aa52dba
...
...
@@ -21,7 +21,7 @@ void bail(int code)
exit
(
code
);
}
long
lputs
(
char
FAR16
*
str
)
long
lputs
(
char
*
str
)
{
char
tmp
[
256
];
int
i
,
j
,
k
;
...
...
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
file_t
workfile
;
scfg_t
cfg
;
glob_t
gl
;
uchar
HUGE16
*
ixbbuf
;
uchar
*
ixbbuf
;
putenv
(
"TZ=UCT0"
);
setvbuf
(
stdout
,
NULL
,
_IONBF
,
0
);
...
...
@@ -199,14 +199,14 @@ for(i=0;i<cfg.total_dirs;i++) {
if
(
!
l
)
{
close
(
file
);
continue
;
}
if
((
ixbbuf
=
(
char
*
)
MALLOC
(
l
))
==
NULL
)
{
if
((
ixbbuf
=
(
char
*
)
malloc
(
l
))
==
NULL
)
{
close
(
file
);
printf
(
"
\7
ERR_ALLOC %s %lu
\n
"
,
str
,
l
);
continue
;
}
if
(
read
(
file
,
ixbbuf
,
l
)
!=
l
)
{
close
(
file
);
printf
(
"
\7
ERR_READ %s %lu
\n
"
,
str
,
l
);
FREE
((
char
*
)
ixbbuf
);
free
((
char
*
)
ixbbuf
);
continue
;
}
close
(
file
);
...
...
@@ -259,5 +259,5 @@ for(i=0;i<cfg.total_dirs;i++) {
if
(
!
(
misc
&
REPORT
))
removefiledat
(
&
cfg
,
&
workfile
);
}
}
FREE
((
char
*
)
ixbbuf
);
}
free
((
char
*
)
ixbbuf
);
}
}
src/sbbs3/dupefind.c
View file @
1aa52dba
...
...
@@ -12,7 +12,7 @@ void bail(int code)
exit
(
code
);
}
long
lputs
(
char
FAR16
*
str
)
long
lputs
(
char
*
str
)
{
char
tmp
[
256
];
int
i
,
j
,
k
;
...
...
@@ -113,7 +113,7 @@ fprintf(stderr,"\nDUPEFIND Version %s (%s) - Synchronet Duplicate File "
if
(
argc
>
2
)
end_lib
=
atoi
(
argv
[
2
])
-
1
;
if
((
fcrc
=
(
ulong
**
)
MALLOC
(
cfg
.
total_dirs
*
sizeof
(
ulong
*
)))
==
NULL
)
{
if
((
fcrc
=
(
ulong
**
)
malloc
(
cfg
.
total_dirs
*
sizeof
(
ulong
*
)))
==
NULL
)
{
printf
(
"Not enough memory for CRCs.
\r\n
"
);
return
(
1
);
}
...
...
@@ -121,27 +121,27 @@ fprintf(stderr,"\nDUPEFIND Version %s (%s) - Synchronet Duplicate File "
fprintf
(
stderr
,
"Reading directory index %u of %u
\r
"
,
i
+
1
,
cfg
.
total_dirs
);
sprintf
(
str
,
"%s%s.ixb"
,
cfg
.
dir
[
i
]
->
data_dir
,
cfg
.
dir
[
i
]
->
code
);
if
((
file
=
nopen
(
str
,
O_RDONLY
|
O_BINARY
))
==-
1
)
{
fcrc
[
i
]
=
(
ulong
*
)
MALLOC
(
1
*
sizeof
(
ulong
));
fcrc
[
i
]
=
(
ulong
*
)
malloc
(
1
*
sizeof
(
ulong
));
fcrc
[
i
][
0
]
=
0
;
continue
;
}
l
=
filelength
(
file
);
if
(
!
l
||
(
cfg
.
dir
[
i
]
->
lib
<
start_lib
||
cfg
.
dir
[
i
]
->
lib
>
end_lib
))
{
close
(
file
);
fcrc
[
i
]
=
(
ulong
*
)
MALLOC
(
1
*
sizeof
(
ulong
));
fcrc
[
i
]
=
(
ulong
*
)
malloc
(
1
*
sizeof
(
ulong
));
fcrc
[
i
][
0
]
=
0
;
continue
;
}
if
((
fcrc
[
i
]
=
(
ulong
*
)
MALLOC
((
l
/
22
+
2
)
*
sizeof
(
ulong
)))
==
NULL
)
{
if
((
fcrc
[
i
]
=
(
ulong
*
)
malloc
((
l
/
22
+
2
)
*
sizeof
(
ulong
)))
==
NULL
)
{
printf
(
"Not enough memory for CRCs.
\r\n
"
);
return
(
1
);
}
fcrc
[
i
][
0
]
=
(
ulong
)(
l
/
22
);
if
((
ixbbuf
=
(
char
*
)
MALLOC
(
l
))
==
NULL
)
{
if
((
ixbbuf
=
(
char
*
)
malloc
(
l
))
==
NULL
)
{
close
(
file
);
printf
(
"
\7
Error allocating memory for index %s.
\r\n
"
,
str
);
continue
;
}
if
(
read
(
file
,
ixbbuf
,
l
)
!=
l
)
{
close
(
file
);
printf
(
"
\7
Error reading %s.
\r\n
"
,
str
);
FREE
(
ixbbuf
);
free
(
ixbbuf
);
continue
;
}
close
(
file
);
j
=
1
;
...
...
@@ -151,7 +151,7 @@ fprintf(stderr,"\nDUPEFIND Version %s (%s) - Synchronet Duplicate File "
strupr
(
str
);
fcrc
[
i
][
j
++
]
=
crc32
(
str
,
0
);
m
+=
22
;
}
FREE
(
ixbbuf
);
}
free
(
ixbbuf
);
}
lputs
(
"
\n
"
);
foundcrc
=
0L
;
...
...
@@ -172,7 +172,7 @@ fprintf(stderr,"\nDUPEFIND Version %s (%s) - Synchronet Duplicate File "
g
=
total_found
+
1
;
}
if
(
g
==
total_found
)
{
++
total_found
;
if
((
foundcrc
=
(
ulong
*
)
REALLOC
(
foundcrc
if
((
foundcrc
=
(
ulong
*
)
realloc
(
foundcrc
,
total_found
*
sizeof
(
ulong
)))
==
NULL
)
{
printf
(
"Out of memory reallocating
\r\n
"
);
return
(
1
);
}
}
...
...
src/sbbs3/echocfg.c
View file @
1aa52dba
...
...
@@ -219,13 +219,13 @@ int main(int argc, char **argv)
read_echo_cfg
();
// savnum=0;
if
((
opt
=
(
char
**
)
MALLOC
(
sizeof
(
char
*
)
*
300
))
==
NULL
)
{
if
((
opt
=
(
char
**
)
malloc
(
sizeof
(
char
*
)
*
300
))
==
NULL
)
{
uifc
.
bail
();
puts
(
"memory allocation error
\n
"
);
exit
(
1
);
}
for
(
i
=
0
;
i
<
300
;
i
++
)
if
((
opt
[
i
]
=
(
char
*
)
MALLOC
(
MAX_OPLN
))
==
NULL
)
{
if
((
opt
[
i
]
=
(
char
*
)
malloc
(
MAX_OPLN
))
==
NULL
)
{
uifc
.
bail
();
puts
(
"memory allocation error
\n
"
);
exit
(
1
);
...
...
@@ -341,7 +341,7 @@ int main(int argc, char **argv)
,
"Node Address (ALL wildcard allowed)"
,
str
,
25
,
K_EDIT
)
<
1
)
continue
;
if
((
cfg
.
nodecfg
=
(
nodecfg_t
*
)
REALLOC
(
cfg
.
nodecfg
if
((
cfg
.
nodecfg
=
(
nodecfg_t
*
)
realloc
(
cfg
.
nodecfg
,
sizeof
(
nodecfg_t
)
*
(
cfg
.
nodecfgs
+
1
)))
==
NULL
)
{
printf
(
"
\n
Memory Allocation Error
\n
"
);
exit
(
1
);
}
...
...
@@ -362,7 +362,7 @@ int main(int argc, char **argv)
for
(
j
=
i
;
j
<
cfg
.
nodecfgs
;
j
++
)
memcpy
(
&
cfg
.
nodecfg
[
j
],
&
cfg
.
nodecfg
[
j
+
1
]
,
sizeof
(
nodecfg_t
));
if
((
cfg
.
nodecfg
=
(
nodecfg_t
*
)
REALLOC
(
cfg
.
nodecfg
if
((
cfg
.
nodecfg
=
(
nodecfg_t
*
)
realloc
(
cfg
.
nodecfg
,
sizeof
(
nodecfg_t
)
*
(
cfg
.
nodecfgs
)))
==
NULL
)
{
printf
(
"
\n
Memory Allocation Error
\n
"
);
exit
(
1
);
}
...
...
@@ -503,7 +503,7 @@ int main(int argc, char **argv)
,
K_EDIT
|
K_UPPER
)
<
1
)
continue
;
if
((
cfg
.
nodecfg
[
i
].
flag
=
(
flag_t
*
)
REALLOC
(
cfg
.
nodecfg
[
i
].
flag
realloc
(
cfg
.
nodecfg
[
i
].
flag
,
sizeof
(
flag_t
)
*
(
cfg
.
nodecfg
[
i
].
numflags
+
1
)))
==
NULL
)
{
printf
(
"
\n
Memory Allocation Error
\n
"
);
...
...
@@ -528,7 +528,7 @@ int main(int argc, char **argv)
strcpy
(
cfg
.
nodecfg
[
i
].
flag
[
j
].
flag
,
cfg
.
nodecfg
[
i
].
flag
[
j
+
1
].
flag
);
if
((
cfg
.
nodecfg
[
i
].
flag
=
(
flag_t
*
)
REALLOC
(
cfg
.
nodecfg
[
i
].
flag
realloc
(
cfg
.
nodecfg
[
i
].
flag
,
sizeof
(
flag_t
)
*
(
cfg
.
nodecfg
[
i
].
numflags
)))
==
NULL
)
{
printf
(
"
\n
Memory Allocation Error
\n
"
);
...
...
@@ -857,7 +857,7 @@ int main(int argc, char **argv)
if
(
uifc
.
input
(
WIN_MID
,
0
,
0
,
"Packer Name"
,
str
,
25
,
K_EDIT
|
K_UPPER
)
<
1
)
continue
;
if
((
cfg
.
arcdef
=
(
arcdef_t
*
)
REALLOC
(
cfg
.
arcdef
if
((
cfg
.
arcdef
=
(
arcdef_t
*
)
realloc
(
cfg
.
arcdef
,
sizeof
(
arcdef_t
)
*
(
cfg
.
arcdefs
+
1
)))
==
NULL
)
{
printf
(
"
\n
Memory Allocation Error
\n
"
);
exit
(
1
);
}
...
...
@@ -880,7 +880,7 @@ int main(int argc, char **argv)
for
(
j
=
i
;
j
<
cfg
.
arcdefs
;
j
++
)
memcpy
(
&
cfg
.
arcdef
[
j
],
&
cfg
.
arcdef
[
j
+
1
]
,
sizeof
(
arcdef_t
));
if
((
cfg
.
arcdef
=
(
arcdef_t
*
)
REALLOC
(
cfg
.
arcdef
if
((
cfg
.
arcdef
=
(
arcdef_t
*
)
realloc
(
cfg
.
arcdef
,
sizeof
(
arcdef_t
)
*
(
cfg
.
arcdefs
)))
==
NULL
)
{
printf
(
"
\n
Memory Allocation Error
\n
"
);
exit
(
1
);
}
...
...
@@ -965,7 +965,7 @@ int main(int argc, char **argv)
if
(
uifc
.
input
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
"Echo List Path/Name"
,
str
,
50
,
K_EDIT
)
<
1
)
continue
;
if
((
cfg
.
listcfg
=
(
echolist_t
*
)
REALLOC
(
cfg
.
listcfg
if
((
cfg
.
listcfg
=
(
echolist_t
*
)
realloc
(
cfg
.
listcfg
,
sizeof
(
echolist_t
)
*
(
cfg
.
listcfgs
+
1
)))
==
NULL
)
{
printf
(
"
\n
Memory Allocation Error
\n
"
);
exit
(
1
);
}
...
...
@@ -986,7 +986,7 @@ int main(int argc, char **argv)
for
(
j
=
i
;
j
<
cfg
.
listcfgs
;
j
++
)
memcpy
(
&
cfg
.
listcfg
[
j
],
&
cfg
.
listcfg
[
j
+
1
]
,
sizeof
(
echolist_t
));
if
((
cfg
.
listcfg
=
(
echolist_t
*
)
REALLOC
(
cfg
.
listcfg
if
((
cfg
.
listcfg
=
(
echolist_t
*
)
realloc
(
cfg
.
listcfg
,
sizeof
(
echolist_t
)
*
(
cfg
.
listcfgs
)))
==
NULL
)
{
printf
(
"
\n
Memory Allocation Error
\n
"
);
exit
(
1
);
}
...
...
@@ -1075,7 +1075,7 @@ int main(int argc, char **argv)
,
K_EDIT
|
K_UPPER
)
<
1
)
continue
;
if
((
cfg
.
listcfg
[
i
].
flag
=
(
flag_t
*
)
REALLOC
(
cfg
.
listcfg
[
i
].
flag
realloc
(
cfg
.
listcfg
[
i
].
flag
,
sizeof
(
flag_t
)
*
(
cfg
.
listcfg
[
i
].
numflags
+
1
)))
==
NULL
)
{
printf
(
"
\n
Memory Allocation Error
\n
"
);
...
...
@@ -1100,7 +1100,7 @@ int main(int argc, char **argv)
strcpy
(
cfg
.
listcfg
[
i
].
flag
[
j
].
flag
,
cfg
.
listcfg
[
i
].
flag
[
j
+
1
].
flag
);
if
((
cfg
.
listcfg
[
i
].
flag
=
(
flag_t
*
)
REALLOC
(
cfg
.
listcfg
[
i
].
flag
realloc
(
cfg
.
listcfg
[
i
].
flag
,
sizeof
(
flag_t
)
*
(
cfg
.
listcfg
[
i
].
numflags
)))
==
NULL
)
{
printf
(
"
\n
Memory Allocation Error
\n
"
);
...
...
src/sbbs3/exec.cpp
View file @
1aa52dba
...
...
@@ -475,15 +475,15 @@ void sbbs_t::freevars(csi_t *bin)
if
(
bin
->
str_var
)
{
for
(
i
=
0
;
i
<
bin
->
str_vars
;
i
++
)
if
(
bin
->
str_var
[
i
])
FREE
(
bin
->
str_var
[
i
]);
FREE
(
bin
->
str_var
);
free
(
bin
->
str_var
[
i
]);
free
(
bin
->
str_var
);
}
if
(
bin
->
int_var
)
FREE
(
bin
->
int_var
);
free
(
bin
->
int_var
);
if
(
bin
->
str_var_name
)
FREE
(
bin
->
str_var_name
);
free
(
bin
->
str_var_name
);
if
(
bin
->
int_var_name
)
FREE
(
bin
->
int_var_name
);
free
(
bin
->
int_var_name
);
for
(
i
=
0
;
i
<
bin
->
files
;
i
++
)
{
if
(
bin
->
file
[
i
])
{
fclose
((
FILE
*
)
bin
->
file
[
i
]);
...
...
@@ -513,7 +513,7 @@ char * sbbs_t::copystrvar(csi_t *csi, char *p, char *str)
if
(
p
==
sysvar_p
[
i
])
break
;
if
(
!
p
||
i
==
MAX_SYSVARS
)
{
/* Not system variable */
if
((
np
=
(
char
*
)
REALLOC
(
p
,
strlen
(
str
)
+
1
))
==
NULL
)
if
((
np
=
(
char
*
)
realloc
(
p
,
strlen
(
str
)
+
1
))
==
NULL
)
errormsg
(
WHERE
,
ERR_ALLOC
,
"variable"
,
strlen
(
str
)
+
1
);
else
p
=
np
;
}
}
...
...
@@ -687,7 +687,7 @@ long sbbs_t::exec_bin(char *mod, csi_t *csi)
}
bin
.
length
=
filelength
(
file
);
if
((
bin
.
cs
=
(
uchar
*
)
MALLOC
(
bin
.
length
))
==
NULL
)
{
if
((
bin
.
cs
=
(
uchar
*
)
malloc
(
bin
.
length
))
==
NULL
)
{
close
(
file
);
errormsg
(
WHERE
,
ERR_ALLOC
,
str
,
bin
.
length
);
return
(
-
1
);
...
...
@@ -695,7 +695,7 @@ long sbbs_t::exec_bin(char *mod, csi_t *csi)
if
(
lread
(
file
,
bin
.
cs
,
bin
.
length
)
!=
bin
.
length
)
{
close
(
file
);
errormsg
(
WHERE
,
ERR_READ
,
str
,
bin
.
length
);
FREE
(
bin
.
cs
);
free
(
bin
.
cs
);
return
(
-
1
);
}
close
(
file
);
...
...
@@ -713,7 +713,7 @@ long sbbs_t::exec_bin(char *mod, csi_t *csi)
}
freevars
(
&
bin
);
FREE
(
bin
.
cs
);
free
(
bin
.
cs
);
csi
->
logic
=
bin
.
logic
;
return
(
bin
.
retval
);
}
...
...
@@ -1064,7 +1064,7 @@ int sbbs_t::exec(csi_t *csi)
for
(
i
=
0
;
i
<
TOTAL_TEXT
;
i
++
)
if
(
text
[
i
]
!=
text_sav
[
i
])
{
if
(
text
[
i
]
!=
nulstr
)
FREE
(
text
[
i
]);
free
(
text
[
i
]);
text
[
i
]
=
text_sav
[
i
];
}
sprintf
(
str
,
"%s%s.dat"
,
cfg
.
ctrl_dir
,
cmdstr
((
char
*
)
csi
->
ip
,
path
,
csi
->
str
,(
char
*
)
buf
));
...
...
@@ -1076,10 +1076,10 @@ int sbbs_t::exec(csi_t *csi)
i
--
;
continue
;
}
if
(
!
strcmp
(
text
[
i
],
text_sav
[
i
]))
{
/* If identical */
FREE
(
text
[
i
]);
/* Don't alloc */
free
(
text
[
i
]);
/* Don't alloc */
text
[
i
]
=
text_sav
[
i
];
}
else
if
(
text
[
i
][
0
]
==
0
)
{
FREE
(
text
[
i
]);
free
(
text
[
i
]);
text
[
i
]
=
nulstr
;
}
}
if
(
i
<
TOTAL_TEXT
)
{
fclose
(
stream
);
...
...
@@ -1326,7 +1326,7 @@ int sbbs_t::exec(csi_t *csi)
if
((
ushort
)
i
==
0xffff
)
{
for
(
i
=
0
;
i
<
TOTAL_TEXT
;
i
++
)
{
if
(
text
[
i
]
!=
text_sav
[
i
]
&&
text
[
i
]
!=
nulstr
)
FREE
(
text
[
i
]);