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
9b2cc301
Commit
9b2cc301
authored
Jun 15, 2010
by
rswindell
Browse files
Minor optimization of fnopen() - removed unnecessary calls to strcpy().
parent
d0ebcb59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
src/sbbs3/nopen.c
src/sbbs3/nopen.c
+8
-8
No files found.
src/sbbs3/nopen.c
View file @
9b2cc301
...
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 200
7
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 20
1
0 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
...
...
@@ -74,7 +74,7 @@ int nopen(const char* str, int access)
/****************************************************************************/
FILE
*
fnopen
(
int
*
fd
,
const
char
*
str
,
int
access
)
{
char
mode
[
128
]
;
char
*
mode
;
int
file
;
FILE
*
stream
;
...
...
@@ -86,19 +86,19 @@ FILE* fnopen(int* fd, const char* str, int access)
if
(
access
&
O_APPEND
)
{
if
((
access
&
O_RDWR
)
==
O_RDWR
)
strcpy
(
mode
,
"a+"
)
;
mode
=
"a+"
;
else
strcpy
(
mode
,
"a"
)
;
mode
=
"a"
;
}
else
if
(
access
&
(
O_TRUNC
|
O_WRONLY
))
{
if
((
access
&
O_RDWR
)
==
O_RDWR
)
strcpy
(
mode
,
"w+"
)
;
mode
=
"w+"
;
else
strcpy
(
mode
,
"w"
)
;
mode
=
"w"
;
}
else
{
if
((
access
&
O_RDWR
)
==
O_RDWR
)
strcpy
(
mode
,
"r+"
)
;
mode
=
"r+"
;
else
strcpy
(
mode
,
"r"
)
;
mode
=
"r"
;
}
stream
=
fdopen
(
file
,
mode
);
if
(
stream
==
NULL
)
{
...
...
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