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
cd20a33c
Commit
cd20a33c
authored
Mar 02, 2022
by
Rob Swindell
💬
Browse files
Fix CID 33261 Argument cannot be negative
parent
bc6e5876
Pipeline
#2828
passed with stage
in 9 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
src/sbbs3/str.cpp
src/sbbs3/str.cpp
+5
-3
No files found.
src/sbbs3/str.cpp
View file @
cd20a33c
...
...
@@ -132,24 +132,26 @@ void sbbs_t::sif(char *fname, char *answers, long len)
int
file
;
long
length
,
l
=
0
,
m
,
top
,
a
=
0
;
*
answers
=
0
;
sprintf
(
str
,
"%s%s.sif"
,
cfg
.
text_dir
,
fname
);
if
((
file
=
nopen
(
str
,
O_RDONLY
))
==-
1
)
{
errormsg
(
WHERE
,
ERR_OPEN
,
str
,
O_RDONLY
);
answers
[
0
]
=
0
;
return
;
}
length
=
(
long
)
filelength
(
file
);
if
(
length
<
0
)
{
errormsg
(
WHERE
,
ERR_CHK
,
str
,
length
);
return
;
}
if
((
buf
=
(
char
*
)
calloc
(
length
+
1
,
1
))
==
0
)
{
close
(
file
);
errormsg
(
WHERE
,
ERR_ALLOC
,
str
,
length
);
answers
[
0
]
=
0
;
return
;
}
if
(
lread
(
file
,
buf
,
length
)
!=
length
)
{
close
(
file
);
free
(
buf
);
errormsg
(
WHERE
,
ERR_READ
,
str
,
length
);
answers
[
0
]
=
0
;
return
;
}
close
(
file
);
...
...
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