Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
0c8d6908
Commit
0c8d6908
authored
Jul 06, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid using strlen.
parent
bfb98f66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
preloader.c
loader/preloader.c
+9
-5
No files found.
loader/preloader.c
View file @
0c8d6908
...
@@ -295,10 +295,11 @@ static inline void *wld_memset( void *dest, int val, size_t len )
...
@@ -295,10 +295,11 @@ static inline void *wld_memset( void *dest, int val, size_t len )
* %x prints a hex number
* %x prints a hex number
* %s prints a string
* %s prints a string
*/
*/
static
void
wld_vsprintf
(
char
*
st
r
,
const
char
*
fmt
,
va_list
args
)
static
int
wld_vsprintf
(
char
*
buffe
r
,
const
char
*
fmt
,
va_list
args
)
{
{
static
const
char
hex_chars
[
16
]
=
"0123456789abcdef"
;
static
const
char
hex_chars
[
16
]
=
"0123456789abcdef"
;
const
char
*
p
=
fmt
;
const
char
*
p
=
fmt
;
char
*
str
=
buffer
;
while
(
*
p
)
while
(
*
p
)
{
{
...
@@ -325,28 +326,31 @@ static void wld_vsprintf(char *str, const char *fmt, va_list args )
...
@@ -325,28 +326,31 @@ static void wld_vsprintf(char *str, const char *fmt, va_list args )
*
str
++
=
*
p
++
;
*
str
++
=
*
p
++
;
}
}
*
str
=
0
;
*
str
=
0
;
return
str
-
buffer
;
}
}
static
void
wld_printf
(
const
char
*
fmt
,
...
)
static
void
wld_printf
(
const
char
*
fmt
,
...
)
{
{
va_list
args
;
va_list
args
;
char
buffer
[
256
];
char
buffer
[
256
];
int
len
;
va_start
(
args
,
fmt
);
va_start
(
args
,
fmt
);
wld_vsprintf
(
buffer
,
fmt
,
args
);
len
=
wld_vsprintf
(
buffer
,
fmt
,
args
);
va_end
(
args
);
va_end
(
args
);
wld_write
(
2
,
buffer
,
strlen
(
buffer
)
);
wld_write
(
2
,
buffer
,
len
);
}
}
static
__attribute__
((
noreturn
))
void
fatal_error
(
const
char
*
fmt
,
...
)
static
__attribute__
((
noreturn
))
void
fatal_error
(
const
char
*
fmt
,
...
)
{
{
va_list
args
;
va_list
args
;
char
buffer
[
256
];
char
buffer
[
256
];
int
len
;
va_start
(
args
,
fmt
);
va_start
(
args
,
fmt
);
wld_vsprintf
(
buffer
,
fmt
,
args
);
len
=
wld_vsprintf
(
buffer
,
fmt
,
args
);
va_end
(
args
);
va_end
(
args
);
wld_write
(
2
,
buffer
,
strlen
(
buffer
)
);
wld_write
(
2
,
buffer
,
len
);
wld_exit
(
1
);
wld_exit
(
1
);
}
}
...
...
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