Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
beb46435
Commit
beb46435
authored
Jul 24, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7487e5f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
net.c
programs/net/net.c
+5
-6
No files found.
programs/net/net.c
View file @
beb46435
...
...
@@ -61,8 +61,7 @@ static int output_vprintf(const WCHAR* fmt, __ms_va_list va_args)
int
len
;
SetLastError
(
NO_ERROR
);
len
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
,
fmt
,
0
,
0
,
str
,
sizeof
(
str
)
/
sizeof
(
*
str
),
&
va_args
);
len
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
,
fmt
,
0
,
0
,
str
,
ARRAY_SIZE
(
str
),
&
va_args
);
if
(
len
==
0
&&
GetLastError
()
!=
NO_ERROR
)
WINE_FIXME
(
"Could not format string: le=%u, fmt=%s
\n
"
,
GetLastError
(),
wine_dbgstr_w
(
fmt
));
else
...
...
@@ -85,7 +84,7 @@ static int WINAPIV output_string(int msg, ...)
WCHAR
fmt
[
8192
];
__ms_va_list
arguments
;
LoadStringW
(
GetModuleHandleW
(
NULL
),
msg
,
fmt
,
sizeof
(
fmt
)
/
sizeof
(
fmt
[
0
]
));
LoadStringW
(
GetModuleHandleW
(
NULL
),
msg
,
fmt
,
ARRAY_SIZE
(
fmt
));
__ms_va_start
(
arguments
,
msg
);
output_vprintf
(
fmt
,
arguments
);
__ms_va_end
(
arguments
);
...
...
@@ -119,7 +118,7 @@ static BOOL net_use(int argc, const WCHAR* argv[])
HMODULE
hmod
=
GetModuleHandleW
(
NULL
);
/* Load the status strings */
for
(
i
=
0
;
i
<
sizeof
(
status
)
/
sizeof
(
*
status
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
status
);
i
++
)
{
status
[
i
]
=
HeapAlloc
(
GetProcessHeap
(),
0
,
1024
*
sizeof
(
**
status
));
LoadStringW
(
hmod
,
STRING_OK
+
i
,
status
[
i
],
1024
);
...
...
@@ -147,7 +146,7 @@ static BOOL net_use(int argc, const WCHAR* argv[])
}
while
(
rc
==
ERROR_MORE_DATA
);
/* Release the status strings */
for
(
i
=
0
;
i
<
sizeof
(
status
)
/
sizeof
(
*
status
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
status
);
i
++
)
HeapFree
(
GetProcessHeap
(),
0
,
status
[
i
]);
return
TRUE
;
...
...
@@ -256,7 +255,7 @@ static BOOL net_service(int operation, const WCHAR* service_name)
return
FALSE
;
}
buffer_size
=
sizeof
(
service_display_name
)
/
sizeof
(
*
service_display_name
);
buffer_size
=
ARRAY_SIZE
(
service_display_name
);
GetServiceDisplayNameW
(
SCManager
,
service_name
,
service_display_name
,
&
buffer_size
);
if
(
!
service_display_name
[
0
])
lstrcpyW
(
service_display_name
,
service_name
);
...
...
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