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
d63d5a1a
Commit
d63d5a1a
authored
20 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Eliminate potential double-slash/backslash in filename returned from
sbbs_get_ini_fname().
parent
dbc16613
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/sbbs_ini.c
+6
-3
6 additions, 3 deletions
src/sbbs3/sbbs_ini.c
with
6 additions
and
3 deletions
src/sbbs3/sbbs_ini.c
+
6
−
3
View file @
d63d5a1a
...
...
@@ -52,7 +52,8 @@ static const char* strLogMask="LogMask";
void
sbbs_get_ini_fname
(
char
*
ini_file
,
char
*
ctrl_dir
,
char
*
pHostName
)
{
char
host_name
[
128
];
char
path
[
MAX_PATH
+
1
];
if
(
pHostName
==
NULL
)
{
#if defined(_WINSOCKAPI_)
WSADATA
WSAData
;
...
...
@@ -64,13 +65,15 @@ void sbbs_get_ini_fname(char* ini_file, char* ctrl_dir, char* pHostName)
#endif
pHostName
=
host_name
;
}
sprintf
(
ini_file
,
"%s%c%s.ini"
,
ctrl_dir
,
PATH_DELIM
,
pHostName
);
SAFECOPY
(
path
,
ctrl_dir
);
backslash
(
path
);
sprintf
(
ini_file
,
"%s.ini"
,
path
,
pHostName
);
#if defined(__unix__) && defined(PREFIX)
if
(
!
fexistcase
(
ini_file
))
sprintf
(
ini_file
,
PREFIX
"/etc/sbbs.ini"
);
#endif
if
(
!
fexistcase
(
ini_file
))
sprintf
(
ini_file
,
"%s
%c
sbbs.ini"
,
ctrl_dir
,
PATH_DELIM
);
sprintf
(
ini_file
,
"%ssbbs.ini"
,
path
);
}
static
void
read_ini_globals
(
FILE
*
fp
,
global_startup_t
*
global
)
...
...
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