Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
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
Terraform modules
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
Sebastian Mayr
wine
Commits
0c8d6908
Commit
0c8d6908
authored
20 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Avoid using strlen.
parent
bfb98f66
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loader/preloader.c
+9
-5
9 additions, 5 deletions
loader/preloader.c
with
9 additions
and
5 deletions
loader/preloader.c
+
9
−
5
View file @
0c8d6908
...
...
@@ -295,10 +295,11 @@ static inline void *wld_memset( void *dest, int val, size_t len )
* %x prints a hex number
* %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"
;
const
char
*
p
=
fmt
;
char
*
str
=
buffer
;
while
(
*
p
)
{
...
...
@@ -325,28 +326,31 @@ static void wld_vsprintf(char *str, const char *fmt, va_list args )
*
str
++
=
*
p
++
;
}
*
str
=
0
;
return
str
-
buffer
;
}
static
void
wld_printf
(
const
char
*
fmt
,
...
)
{
va_list
args
;
char
buffer
[
256
];
int
len
;
va_start
(
args
,
fmt
);
wld_vsprintf
(
buffer
,
fmt
,
args
);
len
=
wld_vsprintf
(
buffer
,
fmt
,
args
);
va_end
(
args
);
wld_write
(
2
,
buffer
,
strlen
(
buffer
)
);
wld_write
(
2
,
buffer
,
len
);
}
static
__attribute__
((
noreturn
))
void
fatal_error
(
const
char
*
fmt
,
...
)
{
va_list
args
;
char
buffer
[
256
];
int
len
;
va_start
(
args
,
fmt
);
wld_vsprintf
(
buffer
,
fmt
,
args
);
len
=
wld_vsprintf
(
buffer
,
fmt
,
args
);
va_end
(
args
);
wld_write
(
2
,
buffer
,
strlen
(
buffer
)
);
wld_write
(
2
,
buffer
,
len
);
wld_exit
(
1
);
}
...
...
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